-
Notifications
You must be signed in to change notification settings - Fork 315
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
4 changed files
with
102 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
name: build | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
type: choice | ||
options: | ||
- dev | ||
- master | ||
default: "dev" | ||
required: true | ||
env: | ||
platform: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./ | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- uses: mikefarah/yq@master | ||
id: get_version | ||
with: | ||
cmd: "yq -p toml -oy '.project.version' pyproject.toml" | ||
- if: ${{ inputs.branch == 'master' }} | ||
name: Build Docker From master | ||
run: | | ||
docker buildx build --push --platform "${{ env.platform }}" \ | ||
-t ${{ secrets.DOCKER_USER }}/genpac \ | ||
-t ${{ secrets.DOCKER_USER }}/genpac:${{steps.get_version.outputs.result}} \ | ||
. | ||
- if: ${{ inputs.branch == 'dev' }} | ||
name: Build Docker From dev | ||
run: | | ||
docker buildx build --push --platform "${{ env.platform }}" \ | ||
-t ${{ secrets.DOCKER_USER }}/genpac:dev . |
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,42 @@ | ||
name: cook-branch | ||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
type: string | ||
default: master | ||
required: true | ||
jobs: | ||
cooking: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout Branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
path: work | ||
- name: Checkout Branch cooked | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: cooked | ||
path: cooked | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: fire | ||
run: | | ||
pip install ./work/ && \ | ||
mkdir -p ./cooked/${{ inputs.branch }} && \ | ||
cd ./cooked/${{ inputs.branch }} && \ | ||
rm -rf * && \ | ||
DEST=. genpac --config=../../work/example/config.ini && \ | ||
ls -alhR ./ | ||
- name: commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
repository: ./cooked | ||
commit_message: update | ||
add_options: '-A' | ||
push_options: '--force' |
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 |
---|---|---|
@@ -1,41 +1,18 @@ | ||
name: cook | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
schedule: | ||
- cron: "0 */12 * * *" | ||
push: | ||
branches: | ||
- dev-hot | ||
|
||
jobs: | ||
cooking: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout Branch dev | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: dev | ||
path: dev | ||
- name: Checkout Branch cooked | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: cooked | ||
path: cooked | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: fire | ||
run: | | ||
pip install ./dev/ && \ | ||
mkdir ./temp && \ | ||
DEST=./temp genpac --config=./dev/example/config.ini | ||
- name: clean and copy | ||
run: | | ||
find ./cooked -maxdepth 1 -type f -name "*.*" ! -name "README.md" ! -name ".gitignore" -delete && \ | ||
cp ./temp/* ./cooked/ | ||
- name: commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
repository: ./cooked | ||
commit_message: update | ||
push_options: '--force' | ||
master: | ||
uses: ./.github/workflows/cook-branch.yml | ||
with: | ||
branch: master | ||
dev: | ||
uses: ./.github/workflows/cook-branch.yml | ||
with: | ||
branch: dev |