Skip to content

Fixed link to website #126

Fixed link to website

Fixed link to website #126

Workflow file for this run

name: Publish Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
REGISTRY: docker.io
IMAGE_NAME: knuthuehne/jedeschule-scrapers
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- uses: actions/checkout@v5
- name: Log in to Docker Hub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f
with:
images: ${{ env.IMAGE_NAME}}
tags: |
type=raw,value=latest
type=sha
- name: Build and push Docker image
id: push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
deploy:
needs: build
runs-on: ubuntu-latest
environment: server
steps:
- name: Pull latest docker images and restart
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd /home/jedeschule/
sudo docker-compose pull scrapers
sudo docker-compose up --detach --build scrapers
sudo docker image prune -f