Skip to content

Commit

Permalink
build: updated github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
pnicolli committed Oct 18, 2023
1 parent 5684cc1 commit 0445653
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
File renamed without changes.
27 changes: 18 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Docker build for latest main version
on:
release:
types: [released]
push:
branches: [main]

jobs:
build_main:
build_develop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -18,21 +18,30 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"

- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: .
file: ./dockerfiles/Dockerfile
tags: redturtletech/io-comune-base:${{ steps.get_version.outputs.VERSION }}
tags: redturtletech/io-comune-base:main
pull: true
push: true
cache-from: type=registry,ref=redturtletech/io-comune-base:${{ steps.get_version.outputs.VERSION }}
cache-from: type=registry,ref=redturtletech/io-comune-base:main
cache-to: type=inline
build-args: |
ADDON_NAME=design-comuni-plone-theme
ADDON_PATH=design-comuni-plone-theme
VOLTO_VERSION=17.0.0-alpha.19
- name: Deploy to rancher
uses: redturtle/[email protected]
with:
host: ${{ secrets.RANCHER_HOST }}
api-username: ${{ secrets.RANCHER_API_USERNAME }}
api-password: ${{ secrets.RANCHER_API_PASSWORD }}
cluster-id: ${{ secrets.RANCHER_CLUSTER_ID }}
project-id: ${{ secrets.RANCHER_PROJECT_ID }}
namespace: ${{ secrets.RANCHER_NAMESPACE_DEVELOP }}
workload: ${{ secrets.RANCHER_WORKLOAD_DEVELOP }}
image: redturtletech/io-comune-base:main
slack-hook-url: ${{ secrets.RANCHER_SLACK_HOOK_URL }}
29 changes: 10 additions & 19 deletions .github/workflows/develop.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Docker build for latest develop version
name: Docker build for latest released version
on:
push:
branches: [develop]
release:
types: [released]

jobs:
build_develop:
build_main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -18,30 +18,21 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"

- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: .
file: ./dockerfiles/Dockerfile
tags: redturtletech/io-comune-base:develop
tags: redturtletech/io-comune-base:${{ steps.get_version.outputs.VERSION }}
pull: true
push: true
cache-from: type=registry,ref=redturtletech/io-comune-base:develop
cache-from: type=registry,ref=redturtletech/io-comune-base:${{ steps.get_version.outputs.VERSION }}
cache-to: type=inline
build-args: |
ADDON_NAME=design-comuni-plone-theme
ADDON_PATH=design-comuni-plone-theme
VOLTO_VERSION=17.0.0-alpha.19
- name: Deploy to rancher
uses: redturtle/[email protected]
with:
host: ${{ secrets.RANCHER_HOST }}
api-username: ${{ secrets.RANCHER_API_USERNAME }}
api-password: ${{ secrets.RANCHER_API_PASSWORD }}
cluster-id: ${{ secrets.RANCHER_CLUSTER_ID }}
project-id: ${{ secrets.RANCHER_PROJECT_ID }}
namespace: ${{ secrets.RANCHER_NAMESPACE_DEVELOP }}
workload: ${{ secrets.RANCHER_WORKLOAD_DEVELOP }}
image: redturtletech/io-comune-base:develop
slack-hook-url: ${{ secrets.RANCHER_SLACK_HOOK_URL }}

0 comments on commit 0445653

Please sign in to comment.