53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
|
name: Deploy
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches: [ main ]
|
||
|
|
||
|
jobs:
|
||
|
|
||
|
deploy:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
|
||
|
- name: Set up QEMU
|
||
|
uses: docker/setup-qemu-action@v1
|
||
|
|
||
|
- name: Set up Docker Buildx
|
||
|
uses: docker/setup-buildx-action@v1
|
||
|
|
||
|
- name: Docker Login
|
||
|
uses: docker/login-action@v1.6.0
|
||
|
with:
|
||
|
registry: ghcr.io
|
||
|
username: $GITHUB_ACTOR
|
||
|
password: ${{ secrets.CR_PAT }}
|
||
|
|
||
|
- name: Build and push Docker images
|
||
|
uses: docker/build-push-action@v2.1.0
|
||
|
with:
|
||
|
pull: true
|
||
|
platforms: linux/amd64,linux/arm64
|
||
|
push: true
|
||
|
tags: ghcr.io/serverwentdown/datetime:latest
|
||
|
|
||
|
- name: Import SSH key
|
||
|
run: |
|
||
|
mkdir -p ~/.ssh
|
||
|
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
|
||
|
chmod 600 ~/.ssh/id_ed25519
|
||
|
|
||
|
- name: Re-pull
|
||
|
run: |
|
||
|
ssh -p 26779 datetime@pricklypear.cacti.makerforce.io podman pull ghcr.io/serverwentdown/datetime:latest
|
||
|
|
||
|
- name: Restart
|
||
|
run: |
|
||
|
ssh -p 26779 datetime@pricklypear.cacti.makerforce.io bash -c 'podman stop datetime; podman rm datetime; podman run --detach --restart always --publish 127.0.0.1:4513:8000 --name datetime ghcr.io/serverwentdown/datetime:latest'
|
||
|
|
||
|
|
||
|
# vim: set et ts=2 sw=2:
|