-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56a617a
commit deda618
Showing
1 changed file
with
15 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,19 @@ | ||
name: Build and Deploy | ||
name: Build hash and deploy to S3 | ||
run-name: "${{ github.actor }} - ${{ github.ref_name }} - ${{ github.run_id }} 🚀" | ||
|
||
on: | ||
push: | ||
branches: ["feature/CB2-10412"] | ||
pull_request: | ||
branches: ["feature/CB2-10412"] | ||
|
||
permissions: | ||
id-token: write | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'develop' | ||
- 'feature/CB2-10412' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.CVS_MGMT_AWS_ROLE }} | ||
aws-region: ${{ secrets.DVSA_AWS_REGION }} | ||
role-session-name: 'cvs-svc-test-station-hash-upload' | ||
|
||
- name: Make bucket name | ||
env: | ||
BUCKET_NAME: ${{ github.event.repository.name }} | ||
run: | | ||
BUCKET_NAME=$(echo "$BUCKET_NAME" | sed -e "s/cvs-//" -e "s/svc-//" -e "s/tsk-//" -e "s/app-//") | ||
echo "BUCKET_NAME=${BUCKET_NAME,,}" >> $GITHUB_ENV | ||
echo "BUCKET_NAME: $BUCKET_NAME" | ||
# def SERVICE_NAME_SHORT=REPO.minus("cvs-").minus("svc-").minus("tsk-").minus("app-").trim() | ||
|
||
|
||
# - name: Check if hash file exists | ||
# run: | | ||
# aws s3api head-object --bucket cvs-services --key test-stations-test/${{ github.sha }}.zip > /dev/null 2>&1 || ZIP_DOES_NOT_EXIST=true | ||
# echo "ZIP_DOES_NOT_EXIST=$ZIP_DOES_NOT_EXIST" >> $GITHUB_ENV | ||
# echo "ZIP_DOES_NOT_EXIST: $ZIP_DOES_NOT_EXIST" >> $GITHUB_STEP_SUMMARY | ||
|
||
# - name: Setup Node.js | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# uses: actions/setup-node@v4 | ||
# with: | ||
# node-version-file: '.nvmrc' | ||
|
||
# - name: Install dependencies | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# run: npm ci | ||
|
||
# - name: Install tools | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# run: npm run tools-setup | ||
|
||
# - name: Build Artifact | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# run: npm run build | ||
|
||
# - name: Test | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# run: npm run test | ||
|
||
# - name: Test I | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# run: npm run test-i | ||
|
||
# - name: Package Artifact | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# env: | ||
# ZIP_NAME: ${{ github.sha }} | ||
# run: npm run package | ||
|
||
# - name: Generate SHA256 hash | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# run: | | ||
# NODE_SHA=$(openssl dgst -sha256 -binary ${{ github.sha }}.zip | openssl enc -base64) | ||
# echo "NODE_SHA=$NODE_SHA" >> $GITHUB_ENV | ||
# echo "NODE_SHA: $NODE_SHA" >> $GITHUB_STEP_SUMMARY | ||
|
||
# - name: Upload hash zip to S3 | ||
# if: ${{ env.ZIP_DOES_NOT_EXIST }} | ||
# run: | | ||
# aws s3 cp ${{ github.sha }}.zip s3://cvs-services/test-stations-test/${{ github.sha }}.zip --metadata 'sha256sum=${{ env.NODE_SHA }},Tag=test-stations-test' | ||
|
||
# - name: Make branch lowercase | ||
# env: | ||
# SHORT_BRANCH: ${{ github.ref_name }} | ||
# run: | | ||
# SHORT_BRANCH=${SHORT_BRANCH##*/} | ||
# echo "SHORT_BRANCH=${SHORT_BRANCH,,}" >> $GITHUB_ENV | ||
|
||
# - name: Upload ref txt to S3 | ||
# run: | | ||
# echo ${{ github.sha }} > hash.txt | ||
# aws s3 cp hash.txt s3://cvs-services/test-stations-test/latestHash_${{ env.SHORT_BRANCH }}.txt --metadata 'Tag=test-stations-test' | ||
Plan: | ||
uses: dvsa/cvs-github-actions/.github/workflows/build-node-hash.yaml@feature/CB2-10412 | ||
with: | ||
branch: ${{ inputs.branch }} | ||
workspace: ${{ inputs.environment }} | ||
runner: ubuntu-latest | ||
secrets: | ||
AWS_MGMT_ROLE: ${{ secrets.AWS_MGMT_ROLE }} |