Skip to content

Commit

Permalink
Fix Docker build IV (#13)
Browse files Browse the repository at this point in the history
* Fix Docker build IV

* hardcode LC username

* Temporily change username to andy5995

* Revert "Temporily change username to andy5995"

This reverts commit 2ce41d2.

* hardcode real username for login

* Add cancel rule

* .docker-test.yml: Add self to path filter (fix) [skip ci]

* Remove pull_request trigger, revert change image ref

* Adjust path filters

* partial revert of previous commit

* Reverted some changes in docker.yml

Portable owner name & repo names back again

---------

Co-authored-by: KaruroChori <[email protected]>
  • Loading branch information
andy5995 and KaruroChori authored Nov 25, 2024
1 parent b5c7d51 commit f9eef02
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: Test Build-Env Docker Image
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

on:
pull_request:
branches: master
paths:
- '**Dockerfile'
- '**docker.yml'
- 'docker/**'
- '!**.md'
- '**docker-test.yml'

jobs:
build-test-env-image:
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: Build-Env Docker Image
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

on:
push:
branches: master
paths:
- '**Dockerfile'
- '**docker.yml'
# workflow_dispatch:
# schedule:
# - cron: '30 11 20 */3 *'
workflow_dispatch:
schedule:
- cron: '25 1 5 * *'

jobs:
build-env-image:
runs-on: ubuntu-24.04
steps:
- name: set lower case owner name
- name: Prepare env for workflow
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
Expand All @@ -32,13 +35,15 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push by digest
- name: Build and push
id: build
uses: docker/build-push-action@v6
env:
REGISTRY_IMAGE: ghcr.io/${{ env.OWNER_LC }}/vs-fltk
with:
file: ./docker/Dockerfile
platforms: ${{ matrix.platform }}
context: ./docker
push: true
tags: ${{ env.REGISTRY_IMAGE }}:build-env
cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:build-env-buildcache
cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:build-env-buildcache,mode=max

0 comments on commit f9eef02

Please sign in to comment.