This commit is contained in:
parent
040aa2c66c
commit
b169fd9109
1 changed files with 27 additions and 0 deletions
27
.forgejo/workflows/docker-image.yaml
Normal file
27
.forgejo/workflows/docker-image.yaml
Normal file
|
@ -0,0 +1,27 @@
|
|||
name: Build the Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue