Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

env : docker-publish update #58

env : docker-publish update

env : docker-publish update #58

name: publish
on:
push:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.actor }}/koj-client:latest
jobs:
publish:
name: publish image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login
run: |
echo ${{ secrets.PAT }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and Publish
run: |
docker build . --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
deploy:
needs: publish
name: deploy image
runs-on: ubuntu-latest
steps:
- name: install ssh keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -p ${{secrets.SSH_PORT}} -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect, login, and pull
env:

Check failure on line 38 in .github/workflows/docker-publish.yml

View workflow run for this annotation

GitHub Actions / publish

Invalid workflow file

The workflow is not valid. .github/workflows/docker-publish.yml (Line: 38, Col: 13): Unexpected value '' .github/workflows/docker-publish.yml (Line: 39, Col: 9): Unexpected value 'DOCKER_USERNAME'
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
ssh -p ${{secrets.SSH_PORT}} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "
cd ${{ secrets.WORK_DIR }}
echo $DOCKER_PASSWORD | docker login ghcr.io -u $DOCKER_USERNAME --password-stdin
docker compose pull
docker compose up -d
exit
"
- name: cleanup
run: rm -rf ~/.ssh