feat(Pipeline): use github actions

This commit is contained in:
Paul Fey 2025-06-01 11:02:52 +02:00
parent 82c66f19e4
commit 4a02fd1e78

View file

@ -2,28 +2,28 @@ name: Build the Docker Image
on: on:
push: push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs: jobs:
docker:
build: runs-on: ubuntu-latest
runs-on: docker
container:
image: docker:dind
steps: steps:
- uses: actions/checkout@v4 -
- name: Log in to Docker Hub name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin uses: docker/login-action@v3
with:
- name: Generate timestamp username: ${{ vars.DOCKER_USERNAME }}
run: echo "TIMESTAMP=$(date +%s)" >> $GITHUB_ENV password: ${{ secrets.DOCKER_PASSWORD }}
-
- name: Build the Docker image name: Set up QEMU
run: docker build . --file Dockerfile --tag "${{ secrets.DOCKER_USERNAME }}"/jekyll-blog:${TIMESTAMP} --tag "${{ secrets.DOCKER_USERNAME }}"/jekyll-blog:latest uses: docker/setup-qemu-action@v3
-
- name: Push the Docker image name: Set up Docker Buildx
run: docker push -a "${{ secrets.DOCKER_USERNAME }}"/jekyll-blog uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags:
- ${{ vars.DOCKER_USERNAME }}/blog:latest
- ${{ vars.DOCKER_USERNAME }}/blog:${{ gitea.sha }}