-
Notifications
You must be signed in to change notification settings - Fork 265
39 lines (37 loc) · 1.16 KB
/
release.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
name: Release
on:
push:
branches: [ "master" ]
paths:
- "data/**"
workflow_dispatch:
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn install
yarn build
gh release create $(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1) public/*
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build image and push
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
IMAGE_VERSION=`cat package.json | jq -r '.version'`
echo $DOCKER_TOKEN | docker login -u metowolf --password-stdin
docker build -t metowolf/vcards:$IMAGE_VERSION .
docker push metowolf/vcards:$IMAGE_VERSION
echo $GITHUB_TOKEN | docker login ghcr.io -u metowolf --password-stdin
docker build -t ghcr.io/metowolf/vcards:$IMAGE_VERSION .
docker push ghcr.io/metowolf/vcards:$IMAGE_VERSION