Compare commits
7
Commits
7241b2a720
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96e7bbf1dd | ||
|
|
884f447200 | ||
|
|
8de1457256 | ||
|
|
fd53b7e696 | ||
|
|
e8b97d4ca4 | ||
|
|
e262429bb1 | ||
|
|
64941b91d3 |
@@ -1,5 +1,5 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
run-name: Building and deploying to Prod 🚀
|
||||
on:
|
||||
push:
|
||||
issue_comment:
|
||||
@@ -10,9 +10,10 @@ jobs:
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
container:
|
||||
image: gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:latest
|
||||
volumes:
|
||||
- act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: host-runner
|
||||
steps:
|
||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- name: Check out repository code
|
||||
@@ -34,22 +35,6 @@ jobs:
|
||||
echo "------------------------------------------------"
|
||||
echo "Next version: $next_version"
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /opt/hostedtoolcache/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
|
||||
- name: inject cache into docker
|
||||
uses: reproducible-containers/buildkit-cache-dance@v3.1.0
|
||||
with:
|
||||
cache-source: /opt/hostedtoolcache/pip
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to gitea
|
||||
uses: docker/login-action@v3
|
||||
@@ -58,20 +43,19 @@ jobs:
|
||||
username: ${{ secrets.USERNAME_GITEA }}
|
||||
password: ${{ secrets.PASSWORD_GITEA }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:latest
|
||||
gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:${{ env.next_version }}
|
||||
cache-from: type=local,src=/opt/hostedtoolcache/.buildx-cache
|
||||
cache-to: type=local,dest=/opt/hostedtoolcache/.buildx-cache-new,mode=max
|
||||
|
||||
- name: Move cache
|
||||
- name: Build image
|
||||
run: |
|
||||
rm -rf /opt/hostedtoolcache/.buildx-cache
|
||||
mv /opt/hostedtoolcache/.buildx-cache-new /opt/hostedtoolcache/.buildx-cache
|
||||
docker build \
|
||||
-t gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:latest \
|
||||
-t gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:${{ env.next_version }} \
|
||||
.
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:latest
|
||||
docker push gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:${{ env.next_version }}
|
||||
|
||||
|
||||
- name: update version in the variable
|
||||
run: |
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
FROM debian:stable-slim
|
||||
RUN apt-get update \
|
||||
&& apt-get install nodejs docker.io -y
|
||||
&& apt-get install nodejs docker.io curl jq npm -y
|
||||
ENV PATH="/usr/bin:${PATH}"
|
||||
|
||||
Reference in New Issue
Block a user