Skip to content

Merge pull request #23 from snypy/sync-with-dockerhub #51

Merge pull request #23 from snypy/sync-with-dockerhub

Merge pull request #23 from snypy/sync-with-dockerhub #51

Workflow file for this run

name: build_images
on:
push:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
service: ["api", "static", "ui"]
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check if build and push is required
run: if docker-compose pull ${{ matrix.service }}; then echo "SKIP=1" >> $GITHUB_ENV; else echo "SKIP=0" >> $GITHUB_ENV; fi
- name: Build container image
run: docker-compose build ${{ matrix.service }}
if: env.SKIP != 1
- 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 }}

Check failure on line 39 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / build_images

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 39, Col: 14): Unrecognized named-value: 'API_REMOTE'. Located at position 1 within expression: API_REMOTE .github/workflows/build.yml (Line: 43, Col: 14): Unrecognized named-value: 'STATIC_REMOTE'. Located at position 1 within expression: STATIC_REMOTE
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'