Skip to content

Commit 45d04be

Browse files
committed
update workflow
1 parent 2ad0d75 commit 45d04be

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
1-
name: "Push to Github Container Registry"
1+
name: Create and publish a Docker image
22

33
on:
44
release:
55
types: [published]
66

7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
711
jobs:
8-
publish:
9-
name: Push bdc-program-studies to GHCR.
12+
build-and-push-image:
1013
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
1117
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
1922
with:
20-
registry: ghcr.io
23+
registry: ${{ env.REGISTRY }}
2124
username: ${{ github.actor }}
2225
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

Comments
 (0)