Adding workflow to push a docker for the action
All checks were successful
Production deployment / Build and pushing (push) Successful in 40s
All checks were successful
Production deployment / Build and pushing (push) Successful in 40s
This commit is contained in:
41
.gitea/workflows/deployment.yml
Normal file
41
.gitea/workflows/deployment.yml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
name: Production deployment
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**' # Any branch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-docker-images:
|
||||||
|
name: "Build and pushing"
|
||||||
|
runs-on: skydust-runner
|
||||||
|
steps:
|
||||||
|
- name: Check out repo's default branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Docker login
|
||||||
|
uses: https://gitea.skydust.fr/actions/docker-login-skydust@main
|
||||||
|
with:
|
||||||
|
user: ${{ gitea.repository_owner }}
|
||||||
|
pass: ${{ secrets.DOCKER_WRITEABLE_TOKEN }}
|
||||||
|
- name: Set branch name and Docker tag
|
||||||
|
id: set_tag
|
||||||
|
run: |
|
||||||
|
raw_ref="${GITHUB_REF#refs/heads/}"
|
||||||
|
|
||||||
|
# Replace any slashes with dashes (for Docker tag compatibility)
|
||||||
|
safe_tag=$(echo "$raw_ref" | tr '/' '-')
|
||||||
|
|
||||||
|
repo_name="${GITHUB_REPOSITORY##*/}"
|
||||||
|
echo "Branch: $raw_ref"
|
||||||
|
echo "Safe Tag: $safe_tag"
|
||||||
|
echo "Repo: ${repo_name}"
|
||||||
|
|
||||||
|
echo "tag=$safe_tag" >> "$GITEA_OUTPUT"
|
||||||
|
echo "repo=$repo_name" >> "$GITEA_OUTPUT"
|
||||||
|
- name: Build and push
|
||||||
|
uses: https://gitea.skydust.fr/actions/docker-build-skydust@main
|
||||||
|
with:
|
||||||
|
imageName: "${{ steps.set_tag.outputs.repo }}:${{ steps.set_tag.outputs.tag }}"
|
||||||
|
push: true
|
||||||
|
pullCache: true
|
||||||
|
platform: linux/amd64
|
||||||
@@ -17,4 +17,4 @@ inputs:
|
|||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: docker
|
using: docker
|
||||||
image: Dockerfile
|
image: gitea.skydust.fr/actions/run-ansible-skydust:main
|
||||||
|
|||||||
@@ -22,4 +22,5 @@ ANSIBLE_OPTIONS+=("$INPUT_PLAYBOOK_PATH")
|
|||||||
echo "Running playbook with options: ansible-playbook ${ANSIBLE_OPTIONS[*]}"
|
echo "Running playbook with options: ansible-playbook ${ANSIBLE_OPTIONS[*]}"
|
||||||
ansible-playbook "${ANSIBLE_OPTIONS[@]}"
|
ansible-playbook "${ANSIBLE_OPTIONS[@]}"
|
||||||
|
|
||||||
|
env
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user