-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.24 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
name: Docker
on:
- push
- pull_request
jobs:
docker:
name: Docker
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure
id: configure
run: |
if [ "${GITHUB_EVENT_NAME}" = "push" ]; then
case "${GITHUB_REF}" in
refs/tags/*)
version=$(echo "${GITHUB_REF}" | sed -e "s,^refs/tags/,,g")
;;
*)
version=latest
;;
esac
tags=ghcr.io/${GITHUB_REPOSITORY}:${version}
push="true"
else
tags=""
push="false"
fi
echo "::set-output name=tags::${tags}"
echo "::set-output name=push::${push}"
- uses: docker/setup-buildx-action@v1
- uses: docker/build-push-action@v2
with:
context: .
file: dockerfiles/ruby-3.0.dockerfile
push: ${{ steps.configure.outputs.push }}
tags: ${{ steps.configure.outputs.tags }}