chore(release): prepare for v2.1.2 #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push to Main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
push: | |
name: Push Docker image to GHCR | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push amd64 Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
platforms: linux/amd64 | |
tags: ghcr.io/antonengelhardt/kicktipp-bot:amd64 | |
# - name: Build and push arm64 Docker image | |
# uses: docker/build-push-action@v2 | |
# with: | |
# context: . | |
# file: Dockerfile | |
# push: true | |
# platforms: linux/arm64 | |
# tags: ghcr.io/antonengelhardt/kicktipp-bot:arm64 | |
deploy-to-server: | |
name: Deploy to Server | |
runs-on: ubuntu-latest | |
needs: push | |
steps: | |
- name: Deploy to Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
port: ${{ secrets.PORT }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
script: | | |
cd ~/kicktipp-bot | |
rm -f .env | |
echo "KICKTIPP_EMAIL=${{ secrets.KICKTIPP_EMAIL }}" >> .env | |
echo "KICKTIPP_PASSWORD=${{ secrets.KICKTIPP_PASSWORD }}" >> .env | |
echo "KICKTIPP_NAME_OF_COMPETITION=${{ secrets.KICKTIPP_NAME_OF_COMPETITION }}" >> .env | |
echo "KICKTIPP_HOURS_UNTIL_GAME=10" >> .env | |
echo "KICKTIPP_RUN_EVERY_X_MINUTES=30" >> .env | |
echo "ZAPIER_URL=${{ secrets.ZAPIER_URL }}" >> .env | |
echo "NTFY_URL=${{ secrets.NTFY_URL }}" >> .env | |
echo "NTFY_USERNAME=${{ secrets.NTFY_USERNAME }}" >> .env | |
echo "NTFY_PASSWORD=${{ secrets.NTFY_PASSWORD }}" >> .env | |
docker pull ghcr.io/antonengelhardt/kicktipp-bot:amd64 | |
docker stop kicktipp-bot || true | |
docker rm kicktipp-bot || true | |
docker run -itd --restart unless-stopped --name kicktipp-bot --env-file .env ghcr.io/antonengelhardt/kicktipp-bot:amd64 | |
deploy-to-kubernetes: | |
name: Deploy to Kubernetes | |
runs-on: ubuntu-latest | |
needs: push | |
steps: | |
- name: Deploy to Kubernetes | |
uses: actions-hub/kubectl@master | |
env: | |
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | |
with: | |
args: rollout restart deployment kicktipp-bot -n kicktipp-bot |