-
Notifications
You must be signed in to change notification settings - Fork 31
52 lines (43 loc) · 1.45 KB
/
ci.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
name: ci
on:
push:
schedule:
- cron: "0 0 * * *"
jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
version:
- master
- release
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set version for master
if: ${{ matrix.version == 'master' }}
run: echo 'VERSION=master' >> $GITHUB_ENV
- name: Set tag for master
if: ${{ matrix.version == 'master' }}
run: echo "TAG=docker.io/mpepping/cyberchef:latest" >> $GITHUB_ENV
- name: Set version for release
if: ${{ matrix.version == 'release' }}
run: curl -s https://api.github.com/repos/gchq/CyberChef/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/VERSION=\1/' >> $GITHUB_ENV
- name: Set tag for release
if: ${{ matrix.version == 'release' }}
run: echo "TAG=docker.io/mpepping/cyberchef:${VERSION}" >> $GITHUB_ENV
- name: Build and push
timeout-minutes: 720
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64,linux/arm64
build-args: VERSION=${{ env.VERSION }}
tags: ${{ env.TAG }}