-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (27 loc) · 1008 Bytes
/
Copy pathdocker.yaml
File metadata and controls
29 lines (27 loc) · 1008 Bytes
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
name: docker
on:
push:
branches: [ main ]
release:
types: [ published ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'release' || github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Login to DockerHub Registry
run: echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
- name: Build the tagged Docker image
if: github.event_name == 'release'
run: docker build . -t ghcr.io/simonprinz/pingwebhook:${GITHUB_REF:11}
- name: Push the tagged Docker image
if: github.event_name == 'release'
run: docker push ghcr.io/simonprinz/pingwebhook:${GITHUB_REF:11}
- name: Tag the latest Docker image
run: docker build . -t ghcr.io/simonprinz/pingwebhook:latest
- name: Push the latest Docker image
run: docker push ghcr.io/simonprinz/pingwebhook:latest