-
Notifications
You must be signed in to change notification settings - Fork 5
43 lines (39 loc) · 1.37 KB
/
build-linux-buildenv.yaml
File metadata and controls
43 lines (39 loc) · 1.37 KB
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
name: Build Linux buildenv image
on:
push:
branches:
- master
paths:
- .github/workflows/tools/containers/buildenv-git-annex/*
- .github/workflows/build-linux-buildenv.yaml
pull_request:
paths:
- .github/workflows/tools/containers/buildenv-git-annex/*
- .github/workflows/build-linux-buildenv.yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v6
- name: Build image
working-directory: .github/workflows/tools/containers/buildenv-git-annex
run: |
set -eux
release=$(sed -nE -e '/FROM/s,.*:(.*),\1,gp' Dockerfile)
freeze_date=$(sed -nE '/nd_freeze/s,.* (20[0-9]*).*,\1,gp' Dockerfile)
commit=$(git rev-parse --short=4 HEAD)
docker build \
-t "datalad/buildenv-git-annex:latest" \
-t "datalad/buildenv-git-annex:${release}" \
-t "datalad/buildenv-git-annex:${release}-${freeze_date}-${commit}" \
.
docker images
- name: Push image
if: github.ref_name == 'master'
run: |
# TODO: switch to some datalad bot account
docker login -u yarikoptic --password-stdin <<<"$DOCKER_TOKEN"
docker push --all-tags datalad/buildenv-git-annex
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}