Use working Gitea workflow format with ubuntu-latest
Build and Push Docker Image / build (push) Successful in 1m45s
Details
Build and Push Docker Image / build (push) Successful in 1m45s
Details
This commit is contained in:
parent
c426d576fc
commit
cb3703ec3a
|
|
@ -1,50 +1,59 @@
|
||||||
name: Build and Deploy
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- master
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: code.letsbe.solutions
|
||||||
|
IMAGE_NAME: letsbe/monacousa-portal
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Set up Docker Buildx
|
||||||
uses: actions/setup-node@v4
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Gitea Container Registry
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Extract metadata (tags, labels)
|
||||||
run: npm ci --legacy-peer-deps
|
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: Build
|
- name: Build and push Docker image
|
||||||
run: npm run build
|
uses: docker/build-push-action@v5
|
||||||
env:
|
with:
|
||||||
PUBLIC_SUPABASE_URL: https://api.portal.monacousa.org
|
context: .
|
||||||
PUBLIC_SUPABASE_ANON_KEY: placeholder
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
SUPABASE_SERVICE_ROLE_KEY: placeholder
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
- name: Build Docker image
|
build-args: |
|
||||||
run: |
|
PUBLIC_SUPABASE_URL=https://api.portal.monacousa.org
|
||||||
docker build -t monacousa-portal:${{ gitea.sha }} \
|
PUBLIC_SUPABASE_ANON_KEY=placeholder
|
||||||
--build-arg PUBLIC_SUPABASE_URL=https://api.portal.monacousa.org \
|
SUPABASE_SERVICE_ROLE_KEY=placeholder
|
||||||
--build-arg PUBLIC_SUPABASE_ANON_KEY=placeholder \
|
|
||||||
--build-arg SUPABASE_SERVICE_ROLE_KEY=placeholder \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Test container starts
|
|
||||||
run: |
|
|
||||||
docker run -d --name test-portal \
|
|
||||||
-e PUBLIC_SUPABASE_URL=https://api.portal.monacousa.org \
|
|
||||||
-e PUBLIC_SUPABASE_ANON_KEY=placeholder \
|
|
||||||
monacousa-portal:${{ gitea.sha }}
|
|
||||||
sleep 5
|
|
||||||
docker logs test-portal
|
|
||||||
docker stop test-portal
|
|
||||||
docker rm test-portal
|
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,59 @@
|
||||||
name: Build and Deploy
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- master
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: code.letsbe.solutions
|
||||||
|
IMAGE_NAME: letsbe/monacousa-portal
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Set up Docker Buildx
|
||||||
uses: actions/setup-node@v4
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Gitea Container Registry
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Extract metadata (tags, labels)
|
||||||
run: npm ci --legacy-peer-deps
|
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: Build
|
- name: Build and push Docker image
|
||||||
run: npm run build
|
uses: docker/build-push-action@v5
|
||||||
env:
|
with:
|
||||||
PUBLIC_SUPABASE_URL: https://api.portal.monacousa.org
|
context: .
|
||||||
PUBLIC_SUPABASE_ANON_KEY: placeholder
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
SUPABASE_SERVICE_ROLE_KEY: placeholder
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
- name: Build Docker image
|
build-args: |
|
||||||
run: |
|
PUBLIC_SUPABASE_URL=https://api.portal.monacousa.org
|
||||||
docker build -t monacousa-portal:${{ gitea.sha }} \
|
PUBLIC_SUPABASE_ANON_KEY=placeholder
|
||||||
--build-arg PUBLIC_SUPABASE_URL=https://api.portal.monacousa.org \
|
SUPABASE_SERVICE_ROLE_KEY=placeholder
|
||||||
--build-arg PUBLIC_SUPABASE_ANON_KEY=placeholder \
|
|
||||||
--build-arg SUPABASE_SERVICE_ROLE_KEY=placeholder \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Test container starts
|
|
||||||
run: |
|
|
||||||
docker run -d --name test-portal \
|
|
||||||
-e PUBLIC_SUPABASE_URL=https://api.portal.monacousa.org \
|
|
||||||
-e PUBLIC_SUPABASE_ANON_KEY=placeholder \
|
|
||||||
monacousa-portal:${{ gitea.sha }}
|
|
||||||
sleep 5
|
|
||||||
docker logs test-portal
|
|
||||||
docker stop test-portal
|
|
||||||
docker rm test-portal
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue