VIA-629 SB Correct start date for 2026 Covid campaign. #237
Workflow file for this run
This file contains hidden or 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
| name: "CI/CD publish" | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| env: | |
| AWS_REGION: eu-west-2 | |
| AWS_S3_ARTEFACTS_BUCKET: vita-${{ secrets.AWS_ACCOUNT_ID }}-artefacts-dev | |
| AWS_S3_RELEASES_BUCKET: vita-${{ secrets.AWS_ACCOUNT_ID }}-releases-dev | |
| jobs: | |
| ################################################################# | |
| # Publish tag - tag a previously built artefact against the SHA | |
| ################################################################# | |
| publish: | |
| name: "Publish ${{ github.ref_name }}" | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: dev | |
| timeout-minutes: 3 | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: "Checkout code" | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Configure AWS credentials" | |
| uses: aws-actions/configure-aws-credentials@v5 | |
| with: | |
| role-session-name: GitHubActionsSession | |
| role-to-assume: ${{ secrets.IAM_ROLE }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: "Copy artefacts from sha=${{ github.sha }} to tag=${{ github.ref_name }}" | |
| run: | | |
| TAG=${{ github.ref_name }} | |
| SHA=${{ github.sha }} | |
| if aws s3 ls "s3://${AWS_S3_ARTEFACTS_BUCKET}/sha/$SHA/" | grep .; then | |
| aws s3 cp "s3://${AWS_S3_ARTEFACTS_BUCKET}/sha/$SHA" "s3://${AWS_S3_RELEASES_BUCKET}/tag/$TAG/" --recursive | |
| else | |
| echo "Error: No build found for SHA: $SHA" | |
| exit 1 | |
| fi | |
| - name: "Get commit history between tags" | |
| run: | | |
| TAG="${{ github.ref_name }}" | |
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 --first-parent "${TAG}^" 2>/dev/null || echo "") | |
| if [[ -z "$PREVIOUS_TAG" ]]; then | |
| echo "No previous tag found. Listing all commits." | |
| COMMIT_RANGE=$(git log --pretty=format:"- %s (%h)") | |
| else | |
| echo "Listing commits between $PREVIOUS_TAG and $TAG." | |
| COMMIT_RANGE=$(git log --pretty=format:"- %s (%h)" "${PREVIOUS_TAG}..${TAG}") | |
| fi | |
| echo "$COMMIT_RANGE" > commit_history.txt | |
| - name: "Create release notes for ${{ github.ref_name }}" | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| body_path: commit_history.txt | |
| draft: false | |
| prerelease: false | |
| # TODO: commented till feature flags are implemented and we are ready for automatic promotions | |
| # promote-stage: | |
| # name: "Promote stage" | |
| # needs: [publish] | |
| # uses: ./.github/workflows/stage-6-promote.yaml | |
| # with: | |
| # environment: "preprod" | |
| # release_tag: ${{ github.ref_name }} | |
| # secrets: inherit |