Skip to content

Commit 90affd0

Browse files
authored
ci: refactors tag_and_publish workflow (#8)
1 parent de44990 commit 90affd0

1 file changed

Lines changed: 6 additions & 30 deletions

File tree

.github/workflows/tag_and_publish.yml

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,10 @@ jobs:
99
secrets:
1010
repo-token: ${{ secrets.SERVICE_TOKEN }}
1111
publish_image:
12-
runs-on: ubuntu-latest
1312
needs: tag
14-
steps:
15-
- uses: actions/checkout@v4
16-
- name: Pull latest changes
17-
run: |
18-
git pull origin main
19-
- name: Fetch tags
20-
run: |
21-
git fetch --prune --unshallow --tags
22-
v_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
23-
tag="${v_tag:1}"
24-
echo "docker_tag=$tag" >> "$GITHUB_ENV"
25-
- name: Set up Docker Buildx
26-
id: buildx
27-
uses: docker/setup-buildx-action@v2
28-
- name: Login to Github Packages
29-
uses: docker/login-action@v2
30-
with:
31-
registry: ghcr.io
32-
username: ${{ github.actor }}
33-
password: ${{ secrets.GITHUB_TOKEN }}
34-
- name: Build image and push to GitHub Container Registry
35-
uses: docker/build-push-action@v3
36-
with:
37-
# relative path to the place where source code with Dockerfile is located
38-
context: .
39-
push: true
40-
tags: |
41-
ghcr.io/allenneuraldynamics/aind-vast-utils:${{ env.docker_tag }}
42-
ghcr.io/allenneuraldynamics/aind-vast-utils:latest
13+
uses: AllenNeuralDynamics/.github/.github/workflows/publish-docker-image.yml@main
14+
with:
15+
docker-tag: needs.tag.outputs.new_version
16+
secrets:
17+
repo-token: ${{ secrets.SERVICE_TOKEN }}
18+

0 commit comments

Comments
 (0)