-
Notifications
You must be signed in to change notification settings - Fork 2
/
sample-dockerhub-workflow.yml
56 lines (51 loc) · 1.54 KB
/
sample-dockerhub-workflow.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
name: xk6bundler
on:
push:
tags:
- "v*"
jobs:
xk6bundler:
name: Bundle xk6 extensions
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build
id: build
uses: szkiba/xk6bundler@v0
with:
platform: linux/amd64 windows/amd64
with: |
github.com/szkiba/[email protected]
github.com/szkiba/[email protected]
github.com/szkiba/[email protected]
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.build.outputs.name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker build and push
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v2
with:
push: true
context: ./${{ steps.build.outputs.dockerdir }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}