Skip to content

Commit

Permalink
feat: add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vrenaville committed Nov 28, 2024
1 parent 9c8bd2d commit 2fa9136
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test, build and push to github packages
on:
pull_request:
branches:
- 'master'
push:
branches:
- '*'
tags:
- '*.*.*'

jobs:
build-images:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set ENV for branch master/main
if: ${{ github.ref == 'refs/heads/master' }}
run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
- name: Set ENV for tags
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set ENV for specific branch
if: ${{ startsWith(github.ref, 'refs/heads/') && !endsWith(github.ref, '/master') }}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}-${GITHUB_SHA}" >> $GITHUB_ENV
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Image Odoo Nginx
uses: docker/build-push-action@v2
with:
context: ./9.0
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}

0 comments on commit 2fa9136

Please sign in to comment.