Skip to content

Build Docker Container #124

Build Docker Container

Build Docker Container #124

Workflow file for this run

name: docker
run-name: Build Docker Container
on:
push:
branches:
- main
paths:
- "src/**"
- "package.json"
pull_request:
branches:
- main
paths:
- "src/**"
- "package.json"
workflow_dispatch: # Also allow manual triggering
jobs:
docker:
env:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ env.dockerhub_username != '' && env.dockerhub_token != '' }}

Check failure on line 24 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / docker

Invalid workflow file

The workflow is not valid. .github/workflows/docker.yml (Line: 24, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.dockerhub_username != '' && env.dockerhub_token != ''
name: Publish Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10.2
with:
versionSpec: "5.x"
- name: Run GitVersion
uses: gittools/actions/gitversion/execute@v0.10.2
with:
useConfigFile: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Determine image version
# shell: bash
run: |
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
echo "IMAGE_VERSION=${{ env.GitVersion_MajorMinorPatch }}-beta" >> $GITHUB_ENV
else
echo "IMAGE_VERSION=${{ env.GitVersion_MajorMinorPatch }}" >> $GITHUB_ENV
fi
- name: Build and push (PR)
uses: docker/build-push-action@v5
if: github.event_name == 'pull_request'
with:
push: true
tags: |
dickwolff/export-to-ghostfolio:${{ env.IMAGE_VERSION }}
build-args: |
IMAGE_VERSION=${{ env.IMAGE_VERSION }}
platforms: linux/amd64,linux/arm64
- name: Build and push (main)
uses: docker/build-push-action@v5
if: github.event_name != 'pull_request'
with:
push: true
tags: |
dickwolff/export-to-ghostfolio:latest
dickwolff/export-to-ghostfolio:${{ env.IMAGE_VERSION }}
build-args: |
IMAGE_VERSION=${{ env.IMAGE_VERSION }}
platforms: linux/amd64,linux/arm64