-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (61 loc) · 1.7 KB
/
Copy pathbuild.yml
File metadata and controls
71 lines (61 loc) · 1.7 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
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
name: Build and push Docker image
on:
push:
branches:
- main
- dev
paths:
- 'ci/conda-lock.yml'
- 'ci/Dockerfile'
- 'ci/apt.txt'
- 'ci/postBuild'
- 'ci/start'
- 'ci/install-vscode-ext.sh'
- 'ci/vscode-extensions.txt'
- '.github/workflows/build.yml'
pull_request:
branches:
- main
- dev
paths:
- 'ci/conda-lock.yml'
- 'ci/Dockerfile'
- 'ci/apt.txt'
- 'ci/postBuild'
- 'ci/start'
- 'ci/install-vscode-ext.sh'
- 'ci/vscode-extensions.txt'
- '.github/workflows/build.yml'
workflow_dispatch:
jobs:
build-and-push-docker:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: "Set Job Environment Variables"
run: |
SHA7="${GITHUB_SHA::7}"
DOCKER_TAG=$SHA7
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
- name: "Set up QEMU"
uses: docker/setup-qemu-action@v4
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v4
- name: "Login to Docker Hub"
uses: docker/login-action@v4.1.0
with:
username: openscapes
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Build and push"
uses: docker/build-push-action@v7.1.0
with:
context: ci
push: ${{ github.event_name != 'pull_request' }}
tags: openscapes/python:latest, openscapes/python:${{ env.DOCKER_TAG }}
- name: Export Full Conda Environment
if: github.event_name != 'pull_request'
run: |
docker run openscapes/python:${{ env.DOCKER_TAG }} conda list --export