Update IMAGE_TAG to preview in docker-compose.yml #47
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: Build and deploy | |
| on: | |
| workflow_dispatch: | |
| push: | |
| concurrency: | |
| group: cd-${{ github.ref }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run tests | |
| uses: ./.github/actions/tests | |
| check-formatting: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run tests | |
| uses: ./.github/actions/check-formatting | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test | |
| - check-formatting | |
| permissions: | |
| packages: write | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Generate version tag | |
| id: version-tag | |
| uses: nationalarchives/ds-docker-actions/.github/actions/get-version-tag@main | |
| - name: Build Docker image | |
| uses: nationalarchives/ds-docker-actions/.github/actions/build@main | |
| with: | |
| version: ${{ steps.version-tag.outputs.version-tag }} | |
| latest: ${{ github.ref == 'refs/heads/main' }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }} | |
| dockerfile-path: ./Dockerfile | |
| wiz-client-id: ${{ secrets.WIZ_CLIENT_ID }} | |
| wiz-client-secret: ${{ secrets.WIZ_CLIENT_SECRET }} | |
| wiz-project-id: ${{ secrets.WIZ_PROJECT_DIGITALSERVICES }} | |
| - name: Create tag | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/github-script@v5 | |
| with: | |
| script: | | |
| github.rest.git.createRef({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: 'refs/tags/v${{ steps.version-tag.outputs.version-tag }}', | |
| sha: context.sha | |
| }) | |
| outputs: | |
| version: ${{ steps.version-tag.outputs.version-tag }} |