Files
go-receipt-tracker/.github/workflows/build.yml
Workflow config file is invalid. Please check your config file: yaml: line 17: did not find expected key
Alex Savin 09b11a9f80
Some checks failed
Deploy Project / deploy (push) Failing after 4s
Testing / test (1.23.x, ubuntu-latest) (push) Successful in 55s
More changes
2025-02-11 17:14:21 -05:00

81 lines
2.6 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches: [develop]
paths-ignore:
- 'README.md'
# - '.github/**'
pull_request:
branches: [develop]
paths-ignore:
- 'README.md'
# - '.github/**'
jobs:
build-and-push:
runs-on: ubuntu-latest
# needs: test
# if: startsWith(github.ref, 'refs/tags')
steps:
# - name: Extract Version
# id: version_step
# run: |
# echo "##[set-output name=version;]VERSION=${GITHUB_REF#$"refs/tags/v"}"
# echo "##[set-output name=version_tag;]$GITHUB_REPOSITORY:${GITHUB_REF#$"refs/tags/v"}"
# echo "##[set-output name=latest_tag;]$GITHUB_REPOSITORY:latest"
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_OUTPUT
echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
# - name: Print Version
# run: |
# echo ${{steps.version_step.outputs.version_tag}}
# echo ${{steps.version_step.outputs.latest_tag}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: |
linux/amd64
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: docker.savin.nyc
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# - name: PrepareReg Names
# id: read-docker-image-identifiers
# run: |
# echo VERSION_TAG=$(echo ${{ steps.version_step.outputs.version_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
# echo LASTEST_TAG=$(echo ${{ steps.version_step.outputs.latest_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
# context: .
# file: ./Dockerfile
platforms: |
linux/amd64
push: true
tags: |
docker.savin.nyc/${{ github.event.repository.name }}:latest
# ${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
# latest
# build-args: |
# docker.savin.nyc/${{ github.event.repository.name }}:latest
# build-args: |
# ${{steps.version_step.outputs.version}}
# docker.savin.nyc/${{ github.event.repository.name }}:${{ env.RELEASE_VERSION }}
# tags: |
# ${{env.VERSION_TAG}}
# ${{env.LASTEST_TAG}}