-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (49 loc) · 1.91 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
name: Build and push docker image
on:
push:
branches:
- stable
- unstable
tags:
- '*'
jobs:
build:
name: Create docker images
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Login to registries
shell: bash
run: |
echo "${{ secrets.QUAY_PASSWORD }}" | docker login -u "${{ secrets.QUAY_USERNAME }}" --password-stdin quay.io/nadyita
echo "${{ secrets.GH_TOKEN }}" | docker login -u gelbpunkt --password-stdin ghcr.io
- name: Get the version
id: vars
shell: bash
run: |
TAG=$(git describe --tags --abbrev=0)
VERSION="${TAG}"
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [ "${TAG}" != "$(git describe --tags --abbrev=1)" ]; then
TAG="${BRANCH}"
fi
echo ::set-output name=tag::$(echo ${TAG})
echo ::set-output name=branch::$(echo ${BRANCH})
- name: Build the docker image for x86_64
shell: bash
run: |
docker build --file Dockerfile \
--tag "quay.io/nadyita/aochatproxy:${{steps.vars.outputs.tag}}" \
--tag "quay.io/nadyita/aochatproxy:${{steps.vars.outputs.branch}}" \
--tag "ghcr.io/nadybot/aochatproxy:${{steps.vars.outputs.tag}}" \
--tag "ghcr.io/nadybot/aochatproxy:${{steps.vars.outputs.branch}}" .
- name: Push the tagged Docker image
shell: bash
run: |
docker push "quay.io/nadyita/aochatproxy:${{steps.vars.outputs.tag}}"
docker push "quay.io/nadyita/aochatproxy:${{steps.vars.outputs.branch}}"
docker push "ghcr.io/nadybot/aochatproxy:${{steps.vars.outputs.tag}}"
docker push "ghcr.io/nadybot/aochatproxy:${{steps.vars.outputs.branch}}"