-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.75 KB
/
build_ids_image.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
name: Build get_project_ids Docker Image
on:
push:
branches:
- main
paths:
- ".github/workflows/build_ids_image.yml"
- "gef-portal-scraper/get_project_ids.py"
pull_request:
branches:
- main
paths:
- ".github/workflows/build_ids_image.yml"
- "gef-portal-scraper/get_project_ids.py"
# these path settings ensure this workflow only executes on a push
# to this YML itself, or any file in the ml-api folder
jobs:
build_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# note: you don't need to setup this token -- GH does it for you
# this step converts your GH username to lowercase if needed (required for ghcr)
# and sets the correct environment variable
- name: Define lowercase repository owner
id: repo
run: echo "REPO_OWNER_LC=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
# this sets the build context to the ml-api folder. It will by default
# build from whatever Dockerfile it finds here
context: ./gef-portal-scraper
file: ./gef-portal-scraper/Dockerfile.get_project_ids
push: true
tags: ghcr.io/${{ env.REPO_OWNER_LC }}/get_project_ids:latest