-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (49 loc) · 1.53 KB
/
docker-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Docker
on:
push:
branches: [main]
tags:
- v*
env:
IMAGE_NAME: website
DJANGO_SETTINGS_MODULE: website.settings
jobs:
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
push: true
tags: |
eduzen/website:latest
eduzen/website:${{ github.sha }}
target: production
file: ./Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
RELEASE=${{ github.sha }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Get today's date in European format
id: date
run: echo "::set-output name=date::$(date +'%d.%m.%Y')"
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.date.outputs.date }}-${{ github.sha }}
tag_name: ${{ steps.date.outputs.date }}-${{ github.sha }}
body: Release ${{ github.sha }} from ${{ steps.date.outputs.date }}