This commit is contained in:
2023-11-18 19:26:40 +01:00
parent 0188c07072
commit ef08a42384
3 changed files with 31 additions and 24 deletions

View File

@@ -14,14 +14,17 @@ jobs:
steps:
# - name: Print to Log
# id: print-to-log
# env:
# REGISTRY: registry.jingoh.fr
# uses: https://github.com/actions/hello-world-docker-action@main
# with:
# who-to-greet: ${{ env.REGISTRY }}
# TEST
- name: Print vars test
run: echo ${{ var.REGISTRY_DOCKER }} ${{ vars.REGISTRY_DOCKER }}
- name: Print Gitea runner tag
run: echo {{ env.GITEA_RUNNER_TAG }}
- name: Get all Gitea runner variables
uses: actions/get-variables-action@v1
with:
env: true
- name: Print all Gitea runner variables
run: echo {{ toJson(steps.get-variables-action.outputs.allVariables) }}
- name: Checkout private tools
uses: https://github.com/actions/checkout@v3
with:
@@ -29,10 +32,10 @@ jobs:
repository: staffadmin/gitea-runner
persist-credentials: false
ssh-strict: false
token: ${{ secrets.ACCESS_TOKEN_GIT }} # `GH_PAT` is a secret that contains your PAT
token: ${{ secrets.ACCESS_TOKEN_GIT }}
ssh-known-hosts: ${{ secrets.SSH_KNOWN_GITEA }}
# Install DOCKER
# INSTALL docker
- run: apt-get update
- run: apt-get install ca-certificates curl gnupg
- run: install -m 0755 -d /etc/apt/keyrings
@@ -42,25 +45,28 @@ jobs:
- run: apt-get update
- run: apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# BUILD & PUSH docker image
- name: Build the Docker image
run: docker build . --file Dockerfile --tag test:$(date +%s)
# - name: Login to registry
# run: docker login -u "test:test" https://registry.jingoh.fr
# # Install the cosign tool except on PR
# # https://github.com/sigstore/cosign-installer
- name: Install cosign
#if: gitea.event_name != 'pull_request'
uses: https://github.com/sigstore/cosign-installer@v2.6.0 #v2.6.0
with:
cosign-release: 'v1.11.0'
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: https://github.com/docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
# # # Install the cosign tool except on PR
# # # https://github.com/sigstore/cosign-installer
# - name: Install cosign
# #if: gitea.event_name != 'pull_request'
# uses: https://github.com/sigstore/cosign-installer@v2.6.0 #v2.6.0
# with:
# cosign-release: 'v1.11.0'
# # Workaround: https://github.com/docker/build-push-action/issues/461
# - name: Setup Docker buildx
# uses: https://github.com/docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY_DOCKER }}
#if: gitea.event_name != 'pull_request'
env:
REGISTRY_DOCKER: registry.jingoh.fr
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY_DOCKER }}

View File

@@ -2,6 +2,8 @@ name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [never]
## Exemple https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest

View File

@@ -1,4 +1,3 @@
# Exemple https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml
# Container image that runs your code
FROM alpine:3.10