-
Notifications
You must be signed in to change notification settings - Fork 2
135 lines (120 loc) · 4.17 KB
/
publish.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: docker & singularity/cvmfs releases
on:
push:
branches-ignore:
- '**'
tags:
- '**'
workflow_dispatch:
inputs:
platform:
description: 'Platform'
default: 'linux/amd64'
required: false
delete:
jobs:
docker:
if: ${{ github.event_name != 'delete' }}
name: "Docker Image"
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
# large-packages: true # TODO: see below...
large-packages: false # TODO: remove once https://github.com/jlumbroso/free-disk-space/issues/4 is fixed
swap-storage: true
- name: Checkout Project
uses: actions/checkout@v3
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: |
icecube/skymap_scanner
tags: |
# branches (PRs)
type=sha,prefix={{branch}}-,enable=${{ github.ref_type == 'branch' }}
# release tags
type=semver,pattern={{major}},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{major}}.{{minor}}.{{patch}},enable=${{ github.ref_type == 'tag' }}
- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
if: ${{ contains(github.event.inputs.platform || 'linux/amd64', 'arm') }}
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Push Docker Image X86_64
# if: ${{ arch != 'arm' }}
uses: docker/build-push-action@v3
with:
context: .
platforms: ${{ github.event.inputs.platform || 'linux/amd64' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
# -
# name: Push Docker Image
# if: ${{ arch == 'arm' }}
# uses: docker/build-push-action@v3
# with:
# context: .
# platforms: linux/amd64,linux/arm64/v8
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.docker_meta.outputs.tags }}
# labels: ${{ steps.docker_meta.outputs.labels }}
cvmfs:
name: CVMFS Image
needs: [docker]
if: |
always() &&
(needs.docker.result == 'success' ||
(needs.docker.result == 'skipped' && github.event_name == 'delete')
)
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: |
icecube/skymap_scanner
flavor: |
latest=false
tags: |
# we only want to put version/sha -specific images on CVMFS
# branches (PRs)
type=sha,prefix={{branch}}-,enable=${{ github.ref_type == 'branch' }}
# release tags
type=semver,pattern={{major}}.{{minor}}.{{patch}},enable=${{ github.ref_type == 'tag' }}
- name: Request Build(s)
if: github.event_name != 'delete'
uses: WIPACrepo/[email protected]
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # so job can git push
docker_tags: ${{ steps.docker_meta.outputs.tags }}
dest_dir: realtime
include_docker_repo: false
- name: Request Removal(s)
if: github.event_name == 'delete'
uses: WIPACrepo/[email protected]
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # so job can git push
remove_regex_path: 'realtime/${{ github.event.ref }}.*'