forked from datajoint/.github
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.04 KB
/
devcontainer-build-publish.yaml
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
name: Build and Publish DevContainer Image
on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
devcontainer-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo curl https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64\
-Lo /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
yq --version
- name: Determine metadata
run: |
PIP_PACKAGE_NAME=$(ls */version.py | cut -d '/' -f 1)
echo "PIP_PACKAGE_NAME=${PIP_PACKAGE_NAME}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Build image
run: |
IMAGE=$(yq eval '.services.app.image' ./.devcontainer/docker-compose.yaml)
docker build -t "${IMAGE}" -f ./.devcontainer/Dockerfile .
docker push "${IMAGE}"