blog/.forgejo/workflows/docker-image.yaml
pauljako 82c66f19e4
Some checks failed
Build the Docker Image / build (push) Failing after 13s
fix(Pipeline): oops
2025-04-21 12:25:26 +02:00

29 lines
No EOL
779 B
YAML

name: Build the Docker Image
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: docker
container:
image: docker:dind
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Generate timestamp
run: echo "TIMESTAMP=$(date +%s)" >> $GITHUB_ENV
- name: Build the Docker image
run: docker build . --file Dockerfile --tag "${{ secrets.DOCKER_USERNAME }}"/jekyll-blog:${TIMESTAMP} --tag "${{ secrets.DOCKER_USERNAME }}"/jekyll-blog:latest
- name: Push the Docker image
run: docker push -a "${{ secrets.DOCKER_USERNAME }}"/jekyll-blog