This repository has been archived by the owner on Oct 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (53 loc) · 1.71 KB
/
docker.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
61
62
63
64
name: Docker
on:
push:
paths-ignore:
- .gitignore
- LICENSE
- '**.md'
branches-ignore:
- 'releases/**'
release:
types:
- published
workflow_dispatch:
env:
DOCKER_BASE_NAME: slashnephy/tweetstorm
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & Push (master)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ env.DOCKER_BASE_NAME }}:latest
- name: Build & Push (dev)
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ env.DOCKER_BASE_NAME }}:dev
- name: Build & Push (Release)
if: github.event_name == 'release'
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ env.DOCKER_BASE_NAME }}:${{ github.event.release.tag_name }}
# 2FA を無効化する必要がある
# https://github.com/peter-evans/dockerhub-description#action-inputs
# - name: Update Docker Hub description
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# uses: peter-evans/dockerhub-description@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# repository: ${{ env.DOCKER_BASE_NAME }}