remove push on commit to save on OCI storage
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 5s
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 5s
This commit is contained in:
parent
8a04317caa
commit
1b7b89ccc6
1 changed files with 26 additions and 31 deletions
|
@ -1,31 +1,26 @@
|
||||||
name: Build and Publish Docker Image on Commit
|
name: Build Docker Image on Commit
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
tags:
|
tags:
|
||||||
- '!' # Exclude tags
|
- '!' # Exclude tags
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-publish:
|
build-and-publish:
|
||||||
runs-on: docker-builder
|
runs-on: docker-builder
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Test Docker Hello World
|
- name: Build and push Docker image
|
||||||
run: |
|
run: |
|
||||||
echo "Testing Docker connection..."
|
REPO=git.merith.xyz/${{ github.repository }}
|
||||||
docker run hello-world
|
|
||||||
|
# Build Docker image
|
||||||
- name: Login to OCI registry
|
docker build -t $REPO:${{ github.sha }} .
|
||||||
run: |
|
|
||||||
echo "${{ secrets.OCI_TOKEN }}" | docker login git.merith.xyz -u "${{ secrets.OCI_USER }}" --password-stdin
|
# Remove the local image to save storage
|
||||||
|
docker rmi $REPO:${{ github.sha }}
|
||||||
- name: Build and push Docker image
|
|
||||||
run: |
|
|
||||||
REPO=git.merith.xyz/${{ github.repository }}
|
|
||||||
# Build and push multi-platform Docker images
|
|
||||||
docker build -t $REPO:${{ github.sha }} --push .
|
|
||||||
|
|
Loading…
Reference in a new issue