From b686a4c9ebb31fa0afc281662bfa5727ef1c841f Mon Sep 17 00:00:00 2001 From: Kevin Reynolds Date: Mon, 22 Apr 2024 23:30:44 -0400 Subject: [PATCH] actions update --- .github/workflows/base-dev.yml | 57 ++++++++++++++++++ .../workflows/{base-ci.yml => base-main.yml} | 0 .github/workflows/site-dev.yml | 57 ++++++++++++++++++ .github/workflows/site-main.yml | 58 +++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 .github/workflows/base-dev.yml rename .github/workflows/{base-ci.yml => base-main.yml} (100%) create mode 100644 .github/workflows/site-dev.yml create mode 100644 .github/workflows/site-main.yml diff --git a/.github/workflows/base-dev.yml b/.github/workflows/base-dev.yml new file mode 100644 index 0000000..bc6df38 --- /dev/null +++ b/.github/workflows/base-dev.yml @@ -0,0 +1,57 @@ +name: base-dev + +on: + workflow_dispatch: + push: + branches: + - 'dev' + paths: + - base/** + tags: + - 'v*' + pull_request: + branches: + - 'dev' + paths: + - base/** +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}/orijen-udf-base + CONTEXT: base +jobs: + docker: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - + name: Login to Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + context: "{{defaultContext}}:${{env.CONTEXT}}" + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/base-ci.yml b/.github/workflows/base-main.yml similarity index 100% rename from .github/workflows/base-ci.yml rename to .github/workflows/base-main.yml diff --git a/.github/workflows/site-dev.yml b/.github/workflows/site-dev.yml new file mode 100644 index 0000000..00bb8bf --- /dev/null +++ b/.github/workflows/site-dev.yml @@ -0,0 +1,57 @@ +name: site-dev + +on: + workflow_dispatch: + push: + branches: + - 'dev' + paths: + - site/** + tags: + - 'v*' + pull_request: + branches: + - 'dev' + paths: + - site/** +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}/orijen-udf-site + CONTEXT: base +jobs: + docker: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - + name: Login to Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + context: "{{defaultContext}}:${{env.CONTEXT}}" + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/site-main.yml b/.github/workflows/site-main.yml new file mode 100644 index 0000000..69d4568 --- /dev/null +++ b/.github/workflows/site-main.yml @@ -0,0 +1,58 @@ +name: site-main + +on: + workflow_dispatch: + push: + branches: + - 'main' + paths: + - site/** + tags: + - 'v*' + pull_request: + branches: + - 'main' + paths: + - site/** +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}/orijen-udf-site + CONTEXT: base +jobs: + docker: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest,enable={{is_default_branch}} + - + name: Login to Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + context: "{{defaultContext}}:${{env.CONTEXT}}" + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file