Compare commits

...

9 Commits

Author SHA1 Message Date
maksim.nabokikh
cedc2a94ec Fix env variables
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 22:11:41 +01:00
maksim.nabokikh
da82b6e9b2 Disable buildah
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 22:08:18 +01:00
maksim.nabokikh
2e526b7570 Make workflow prettier
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 22:06:02 +01:00
maksim.nabokikh
38ed4afcb4 Migrate to jq
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 21:59:38 +01:00
maksim.nabokikh
a6baacd57f Migrate to jq
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 21:12:23 +01:00
maksim.nabokikh
0ba9eba9ba Migrate to jq
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 21:00:46 +01:00
maksim.nabokikh
79ae6270d2 Fix env variables
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 20:39:01 +01:00
maksim.nabokikh
5722b2aec8 Fix actions file
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 20:36:57 +01:00
maksim.nabokikh
1fae52e85c Try using werf
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
2025-03-03 20:33:57 +01:00
3 changed files with 25 additions and 38 deletions

View File

@ -12,7 +12,7 @@ updates:
schedule:
interval: "weekly"
# Dependencies listed in Dockerfile.ovpn-admin
# Dependencies listed in Dockerfile
- package-ecosystem: "docker"
directory: "/"
schedule:

View File

@ -9,16 +9,14 @@ on:
branches:
- master
env:
WERF_STAGED_DOCKERFILE_VERSION: v2
# WERF_BUILDAH_MODE: auto
jobs:
build:
name: build images for tag
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: ovpn-admin
- name: openvpn
steps:
- name: Checkout code
@ -26,40 +24,29 @@ jobs:
with:
fetch-depth: 0
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: werf/actions/install@v1.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login into ghcr.io
shell: bash
run: werf cr login -u ${{ github.actor }} -p ${{ github.token }} ghcr.io/${{ github.repository }}
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DECKHOUSE_REGISTRY_USER }}
password: ${{ secrets.DECKHOUSE_REGISTRY_PASSWORD }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.6.1
with:
images: ghcr.io/${{ github.repository }}/${{ matrix.name }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Push Image
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
TAG=${{ github.ref_name }}
platforms: linux/amd64,linux/arm64,linux/arm
file: ./Dockerfile.${{ matrix.name }}
- name: Build Image
if: ${{ github.event_name == 'pull_request' }}
run: |
source "$(werf ci-env github --as-file)"
source <(jq -r '.labels | to_entries | to_entries[] | "export WERF_EXPORT_ADD_LABEL_\(.key)=\"\(.value.key)=\(.value.value)\""' <<< $DOCKER_METADATA_OUTPUT_JSON)
werf build
- name: Build and Push Image
if: ${{ github.event_name != 'pull_request' }}
run: |
source "$(werf ci-env github --as-file)"
source <(jq -r '.labels | to_entries | to_entries[] | "export WERF_EXPORT_ADD_LABEL_\(.key)=\"\(.value.key)=\(.value.value)\""' <<< $DOCKER_METADATA_OUTPUT_JSON)
werf export --tag ghcr.io/${{ github.repository }}/%image%:${{ github.ref_name }}

View File

@ -17,4 +17,4 @@ RUN apk add --update bash easy-rsa openssl openvpn coreutils && \
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
wget https://github.com/pashcovich/openvpn-user/releases/download/v1.0.4/openvpn-user-linux-${TARGETARCH}.tar.gz -O - | tar xz -C /usr/local/bin && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*
RUN if [ -f "/usr/local/bin/openvpn-user-${TARGETARCH}" ]; then ln -s /usr/local/bin/openvpn-user-${TARGETARCH} /usr/local/bin/openvpn-user; fi
RUN if [ -f "/usr/local/bin/openvpn-user-${TARGETARCH}" ]; then ln -s /usr/local/bin/openvpn-user-${TARGETARCH} /usr/local/bin/openvpn-user; fi