-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (35 loc) · 1.27 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
name: Publish Docker image
on:
workflow_dispatch:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: check out the repo
uses: actions/checkout@v2
- name: get project version
id: get_version
run: |
echo ::set-output name=version_tag::$(cat ./meta.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
echo "project version - v${{ steps.get_version.outputs.version_tag }}"
- name: version dockerfile
run: sed -i 's/v0.0.0/v${{ steps.get_version.outputs.version_tag}}/g' Dockerfile
- name: set up Docker builder
uses: docker/setup-buildx-action@v1
- name: log into GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push to Github Container Registry
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/metafam/shepherd-bot:v${{ steps.get_version.outputs.version_tag}}
ghcr.io/metafam/shepherd-bot:latest