-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
177d1e6
commit 1a993bc
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build gef-portal-scraper Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/build_gef_scraper.yml" | ||
- "gef-portal-scraper/**" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/build_gef_scraper.yml" | ||
- "gef-portal-scraper/**" | ||
# these path settings ensure this workflow only executes on a push | ||
# to this YML itself, or any file in the gef-portal-scraper 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 gef-portal-scraper folder. It will by default | ||
# build from whatever Dockerfile it finds here | ||
context: ./gef-portal-scraper | ||
push: true | ||
tags: ghcr.io/${{ env.REPO_OWNER_LC }}/gef-portal-scraper:latest |