Skip to content

Commit

Permalink
Merge pull request #23 from snypy/sync-with-dockerhub
Browse files Browse the repository at this point in the history
Extend build action to sync images to dockerhub
  • Loading branch information
nezhar authored Oct 21, 2023
2 parents 67c6511 + 43a92b9 commit 393ef92
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ jobs:
service: ["api", "static", "ui"]

steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -32,3 +31,37 @@ jobs:
- name: Push container image
run: docker-compose push ${{ matrix.service }}
if: env.SKIP != 1

- name: Dotenv Action
uses: falti/dotenv-action@v1.0.4

- name: Tag api container for dockerhub
run: docker tag ${{ API_REMOTE }}:${{ API_VERSION }} snypy/backend:${{ API_VERSION }}
if: env.SKIP != 1 && matrix.service == 'api'

- name: Tag static container for dockerhub
run: docker tag ${{ STATIC_REMOTE }}:${{ STATIC_VERSION }} snypy/static:${{ STATIC_VERSION }}
if: env.SKIP != 1 && matrix.service == 'static'

- name: Tag ui container for dockerhub
run: docker tag ${{ UI_REMOTE }}:${{ UI_VERSION }} snypy/frontend:${{ UI_VERSION }}
if: env.SKIP != 1 && matrix.service == 'ui'

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push api container to dockerhub
run: docker push snypy/backend:${{ API_VERSION }}
if: env.SKIP != 1 && matrix.service == 'api'

- name: Push static container to dockerhub
run: docker push snypy/static:${{ STATIC_VERSION }}
if: env.SKIP != 1 && matrix.service == 'static'

- name: Push ui container to dockerhub
run: docker push snypy/frontend:${{ UI_VERSION }}
if: env.SKIP != 1 && matrix.service == 'ui'

0 comments on commit 393ef92

Please sign in to comment.