Skip to content

Commit

Permalink
add conditional step to make new docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Dec 3, 2024
1 parent d531170 commit e71abda
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
ghcr-username: ${{ github.actor }}
ghcr-password: ${{ secrets.GITHUB_TOKEN }}

- name: Checking
run: |
GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)
curl "https://ghcr.io/v2/mrc-ide/wodin/manifests/mrc-5976" -H "accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer ${GHCR_TOKEN}"
- name: Build and push docker
uses: docker/build-push-action@v5
with:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,20 @@ jobs:
run: npm run lint --prefix=app/server
- name: Lint front end
run: npm run lint --prefix=app/static

publish-latest-image:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/mrc-5976'
needs: [fe-unit-tests, be-unit-tests, integration-tests, playwright-tests, lint]
steps:
- name: Publish image manifest to latest
run: |
GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)
curl "https://ghcr.io/v2/mrc-ide/wodin/manifests/mrc-5976" \
-H "accept: application/vnd.docker.distribution.manifest.v2+json" \
-H "Authorization: Bearer ${GHCR_TOKEN}" \
> manifest.json
curl -XPUT "https://ghcr.io/v2/mrc-ide/wodin/manifests/test-latest" \
-H "content-type: application/vnd.docker.distribution.manifest.v2+json" \
-H "Authorization: Bearer ${GHCR_TOKEN}" \
-d '@d manifest.json'

0 comments on commit e71abda

Please sign in to comment.