Skip to content

fix: syntax error on workflows/docker-image.yml (5/?) #15

fix: syntax error on workflows/docker-image.yml (5/?)

fix: syntax error on workflows/docker-image.yml (5/?) #15

Workflow file for this run

name: ci
on:
push:
branches:
- "main"
env:
TEST_TAG: uveec/clockbox:test
LATEST_TAG: uveec/clockbox:latest
jobs:
setup:
runs-on: ubuntu-22.04
steps:
- name: Add private key to SSH_AUTH_SOCK
run: |

Check failure on line 17 in .github/workflows/docker-image.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-image.yml

Invalid workflow file

You have an error in your yaml syntax on line 17
apt-get update -y && apt-get install openssh-client -y
## https://stackoverflow.com/questions/70507811/invalid-empty-ssh-agent-socket-make-sure-ssh-auth-sock-is-set-how-to-set-ssh-au
##
## Install ssh-agent if not already installed, it is required by Docker.
## (change apt-get to yum if you use an RPM-based image)
##
##
## Run ssh-agent (inside the build environment)
##
eval $(ssh-agent -s)
##
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
docker:
runs-on: ubuntu-22.04
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- 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: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}
- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.LATEST_TAG }}