-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from rtCamp/action/images-bake
Automated Docker image baking with GitHub Action
- Loading branch information
Showing
3 changed files
with
67 additions
and
37 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,62 @@ | ||
name: Publish image | ||
|
||
on: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build-and-push: | ||
name: Build and push image | ||
strategy: | ||
matrix: | ||
os: [self-hosted-arm64,ubuntu-latest] | ||
platform: [linux/amd64, linux/arm64] | ||
service_name: [frappe, mailhog, nginx] | ||
exclude: | ||
- os: ubuntu-latest | ||
platform: linux/arm64 | ||
- os: self-hosted-arm64 | ||
platform: linux/amd64 | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up tag | ||
id: set-tag | ||
run: | | ||
latest_tag=$(git describe --abbrev=0 --tags) | ||
if [[ "${{ github.ref == 'refs/tags/v*' }}" == 'true' ]]; then | ||
latest-tag=${GITHUB_REF/refs\/tags\//} | ||
fi | ||
owner=$( echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]' ) | ||
echo "Checkout: $latest_tag" | ||
git checkout "$latest_tag" | ||
tag=$( cat "$GITHUB_WORKSPACE/Docker/images-tag.json" | jq -rc .${{ matrix.service_name }}) | ||
echo "image_name=ghcr.io/${owner}/frappe-manager-${{ matrix.service_name }}:${tag}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: ${{ matrix.platform }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USER }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: Docker/${{ matrix.service_name }}/. | ||
push: true | ||
platforms: ${{ matrix.platform }} | ||
tags: ${{ env.image_name }} |
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,5 @@ | ||
{ | ||
"frappe": "v0.11.0", | ||
"nginx": "v0.10.0", | ||
"mailhog": "v0.8.3" | ||
} |