Skip to content

v1.3.1

v1.3.1 #17

Workflow file for this run

name: Publish
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/lucascorpion/npmbadge.com:${{ github.ref_name }}
ghcr.io/lucascorpion/npmbadge.com:latest
deploy:
needs: [publish]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deployment script
run: |
mkdir -p "$HOME/.ssh"
echo "$SSH_KEY" > "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
ssh-keyscan -H 'npmbadge.com' > "$HOME/.ssh/known_hosts"
docker stack deploy --with-registry-auth --resolve-image always --prune --compose-file ./production-stack.yml 'npmbadge'
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
DOCKER_HOST: 'ssh://azureuser@npmbadge.com'