Compare commits
10
Commits
9e78e40069
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96e7bbf1dd | ||
|
|
884f447200 | ||
|
|
8de1457256 | ||
|
|
fd53b7e696 | ||
|
|
e8b97d4ca4 | ||
|
|
e262429bb1 | ||
|
|
64941b91d3 | ||
|
|
7241b2a720 | ||
|
|
a55cb2bf94 | ||
|
|
7d915fb6e7 |
@@ -1,5 +1,5 @@
|
|||||||
name: Gitea Actions Demo
|
name: Gitea Actions Demo
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
run-name: Building and deploying to Prod 🚀
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
issue_comment:
|
issue_comment:
|
||||||
@@ -10,9 +10,10 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUNNER_TOOL_CACHE: /toolcache
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
container:
|
container:
|
||||||
|
image: gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:latest
|
||||||
volumes:
|
volumes:
|
||||||
- act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default
|
- act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default
|
||||||
runs-on: ubuntu-latest
|
runs-on: host-runner
|
||||||
steps:
|
steps:
|
||||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
@@ -34,22 +35,6 @@ jobs:
|
|||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Next version: $next_version"
|
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
|
- name: Login to gitea
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@@ -58,20 +43,19 @@ jobs:
|
|||||||
username: ${{ secrets.USERNAME_GITEA }}
|
username: ${{ secrets.USERNAME_GITEA }}
|
||||||
password: ${{ secrets.PASSWORD_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: |
|
run: |
|
||||||
rm -rf /opt/hostedtoolcache/.buildx-cache
|
docker build \
|
||||||
mv /opt/hostedtoolcache/.buildx-cache-new /opt/hostedtoolcache/.buildx-cache
|
-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
|
- name: update version in the variable
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+2
-14
@@ -1,16 +1,4 @@
|
|||||||
FROM debian:stable-slim
|
FROM debian:stable-slim
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install nodejs ca-certificates curl -y
|
&& apt-get install nodejs docker.io curl jq npm -y
|
||||||
RUN install -m 0755 -d /etc/apt/keyrings
|
ENV PATH="/usr/bin:${PATH}"
|
||||||
RUN curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
|
||||||
RUN chmod a+r /etc/apt/keyrings/docker.asc
|
|
||||||
RUN tee /etc/apt/sources.list.d/docker.sources <<EOF
|
|
||||||
Types: deb
|
|
||||||
URIs: https://download.docker.com/linux/debian
|
|
||||||
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
|
|
||||||
Components: stable
|
|
||||||
Signed-By: /etc/apt/keyrings/docker.asc
|
|
||||||
EOF
|
|
||||||
|
|
||||||
RUN apt-get update -y
|
|
||||||
RUN apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
||||||
|
|||||||
Reference in New Issue
Block a user