Skip to content

Merge branch 'master' of https://github.com/PartTimeLegend/hammy-mcha… #2

Merge branch 'master' of https://github.com/PartTimeLegend/hammy-mcha…

Merge branch 'master' of https://github.com/PartTimeLegend/hammy-mcha… #2

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
branches:
- master
jobs:
build-and-publish:
runs-on: ubuntu-latest
env:
BUILD_DATE: ${{ github.event.head_commit.timestamp }}
IMAGE_NAME: hammy-mchamilton
steps:
- name: Checkout code
uses: actions/checkout@v2 # Check out your repository's code
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate build number tag
id: generate_tag
run: echo ::set-output name=tag::${GITHUB_RUN_NUMBER}
- name: Convert repository owner to lowercase
run: echo "::set-env name=REPOSITORY_OWNER::${{ github.repository_owner | lower }}"

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

View workflow run for this annotation

GitHub Actions / Build and Publish Docker Image

Invalid workflow file

The workflow is not valid. .github/workflows/docker.yml (Line: 35, Col: 14): Unexpected symbol: '|'. Located at position 25 within expression: github.repository_owner | lower
- name: Build the Docker image
run: docker build --file Dockerfile --tag ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}:${{ steps.generate_tag.outputs.tag }} --tag ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}:latest --build-arg BUILD_DATE=${BUILD_DATE} .
- name: Push the Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}:${{ steps.generate_tag.outputs.tag }} && docker push ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}:latest