added mikrotik-tailscale setup
All checks were successful
Build and Push mikrotik-tailscale Container / build-and-push-arch (arm64) (push) Successful in 9s
Build and Push mikrotik-tailscale Container / build-and-push-arch (amd64) (push) Successful in -3s
Build and Push mikrotik-tailscale Container / merge-images-via-manifest (push) Successful in -6s
All checks were successful
Build and Push mikrotik-tailscale Container / build-and-push-arch (arm64) (push) Successful in 9s
Build and Push mikrotik-tailscale Container / build-and-push-arch (amd64) (push) Successful in -3s
Build and Push mikrotik-tailscale Container / merge-images-via-manifest (push) Successful in -6s
This commit is contained in:
parent
a1c46645da
commit
ff9b13e39e
3 changed files with 88 additions and 0 deletions
66
.forgejo/workflows/mikrotik-tailscale.yml
Normal file
66
.forgejo/workflows/mikrotik-tailscale.yml
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
# Workflow name
|
||||||
|
name: Build and Push mikrotik-tailscale Container
|
||||||
|
|
||||||
|
# Run-name for each workflow run
|
||||||
|
run-name: Build and Push mikrotik-tailscale Container
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'containers/mikrotik-tailscale/**'
|
||||||
|
- '.forgejo/workflows/mikrotik-tailscale.yml'
|
||||||
|
workflow_dispatch: {}
|
||||||
|
schedule:
|
||||||
|
- cron: '0 18 * * 5' # Runs every Friday at 6 PM UTC
|
||||||
|
|
||||||
|
env:
|
||||||
|
CONTAINER_NAME: mikrotik-tailscale
|
||||||
|
# USER: ${{ github.actor }}
|
||||||
|
USER: hbms
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-arch:
|
||||||
|
runs-on: ${{ matrix.arch }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: [ amd64, arm64 ]
|
||||||
|
container:
|
||||||
|
image: ghcr.io/catthehacker/ubuntu:act-22.04
|
||||||
|
steps:
|
||||||
|
- name: Prepare environment variables
|
||||||
|
run: |
|
||||||
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
|
echo REGISTRY=${{ vars.REGISTRY }} >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checkout the repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to the registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ vars.REGISTRY }}
|
||||||
|
username: ${{ env.USER }}
|
||||||
|
password: ${{ secrets.PACKAGE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ./containers/alpine/
|
||||||
|
file: ./containers/alpine/Dockerfile
|
||||||
|
push: true
|
||||||
|
provenance: false
|
||||||
|
tags: ${{ vars.REGISTRY }}/${{ env.USER }}/${{ env.CONTAINER_NAME }}-${{ matrix.arch }}:latest
|
||||||
|
|
||||||
|
merge-images-via-manifest:
|
||||||
|
runs-on: amd64
|
||||||
|
needs: build-and-push-arch
|
||||||
|
container:
|
||||||
|
image: ghcr.io/catthehacker/ubuntu:act-22.04
|
||||||
|
steps:
|
||||||
|
- name: Generate and push multi-arch manifest
|
||||||
|
run: |
|
||||||
|
echo REGISTRY=${{ vars.REGISTRY }} >> $GITHUB_ENV
|
||||||
|
echo ${{ secrets.PACKAGE_TOKEN }} | docker login ${{ vars.REGISTRY }} -u ${USER} --password-stdin
|
||||||
|
docker manifest create ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}:latest ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}-amd64:latest ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}-arm64:latest
|
||||||
|
docker manifest push ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}:latest
|
||||||
18
containers/mikrotik-tailscale/Dockerfile
Normal file
18
containers/mikrotik-tailscale/Dockerfile
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
FROM alpine:edge
|
||||||
|
|
||||||
|
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
|
||||||
|
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
|
||||||
|
|
||||||
|
RUN apk upgrade --no-cache --update
|
||||||
|
RUN apk add --no-cache tailscale
|
||||||
|
|
||||||
|
COPY start-tailscale.sh /usr/local/bin/start-tailscale.sh
|
||||||
|
RUN chmod +x /usr/local/bin/start-tailscale.sh
|
||||||
|
|
||||||
|
EXPOSE 22
|
||||||
|
|
||||||
|
CMD ["/usr/local/bin/start-tailscale.sh"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
4
containers/mikrotik-tailscale/start-tailscale.sh
Normal file
4
containers/mikrotik-tailscale/start-tailscale.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Start tailscale with arguments from ARGS environment variable
|
||||||
|
tailscale up --reset ${ARGS}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue