-
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
Showing
1 changed file
with
52 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,52 @@ | ||
#Location: .github/workflows/custom_config.yml | ||
|
||
name: Build and push containers to Github Container Registry and apply rolling update | ||
on: | ||
push: | ||
branches: | ||
- staging | ||
- develop | ||
- main | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Getting image tag | ||
uses: actions/github-script@v6 | ||
id: get_image_tag | ||
with: | ||
result-encoding: string | ||
script: | | ||
return context.payload.ref.replace(/.*\//, ''); | ||
- name: Create and push docker image | ||
run: | | ||
# login to ghcr.io | ||
docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} | ||
# build with full metadata | ||
docker build \ | ||
--label "org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY}" \ | ||
--label "org.opencontainers.image.description=Deposit payment example dockerized app" \ | ||
--label "org.opencontainers.image.licenses=MIT" \ | ||
-t ghcr.io/golemfactory/deposit_example:${{ steps.get_image_tag.outputs.result }} \ | ||
--build-arg BACKEND_URL=http://deposit.dev.golem.network:5174 \ | ||
. | ||
# push one image with two tags into repository | ||
docker push --all-tags ghcr.io/golemfactory/deposit_example | ||
- name: Notify Staging | ||
continue-on-error: true | ||
if: ${{ steps.get_image_tag.outputs.result == 'staging' }} | ||
run: curl http://deposit.dev.golem.network:5000/release/pull |