|
1 | | -name: "Push to Github Container Registry" |
| 1 | +name: Create and publish a Docker image |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | release: |
5 | 5 | types: [published] |
6 | 6 |
|
| 7 | +env: |
| 8 | + REGISTRY: ghcr.io |
| 9 | + IMAGE_NAME: ${{ github.repository }} |
| 10 | + |
7 | 11 | jobs: |
8 | | - publish: |
9 | | - name: Push bdc-program-studies to GHCR. |
| 12 | + build-and-push-image: |
10 | 13 | runs-on: ubuntu-latest |
| 14 | + permissions: |
| 15 | + contents: read |
| 16 | + packages: write |
11 | 17 | steps: |
12 | | - - name: Check out the repo |
13 | | - uses: actions/checkout@v2 |
14 | | - - name: Get the version |
15 | | - id: get_version |
16 | | - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} |
17 | | - - name: Push bdc-program-studies |
18 | | - uses: docker/build-push-action@v1 |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + - name: Log in to the Container registry |
| 21 | + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 |
19 | 22 | with: |
20 | | - registry: ghcr.io |
| 23 | + registry: ${{ env.REGISTRY }} |
21 | 24 | username: ${{ github.actor }} |
22 | 25 | password: ${{ secrets.GITHUB_TOKEN }} |
23 | | - path: . |
24 | | - dockerfile: ./Dockerfile |
25 | | - repository: stagecc/bdc-program-studies |
26 | | - tags: latest,${{ steps.get_version.outputs.VERSION }} |
| 26 | + - name: Extract metadata (tags, labels) for Docker |
| 27 | + id: meta |
| 28 | + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 |
| 29 | + with: |
| 30 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 31 | + - name: Build and push Docker image |
| 32 | + id: push |
| 33 | + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 |
| 34 | + with: |
| 35 | + context: . |
| 36 | + push: true |
| 37 | + build-args: VITE_DUG_SEARCH_API=https://search-dev.biodatacatalyst.renci.org |
| 38 | + platform: linux/amd64 |
| 39 | + tags: ${{ steps.meta.outputs.tags }} |
0 commit comments