Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Merge pull request #8 from ssl-leiden/various-updates #24

Merge pull request #8 from ssl-leiden/various-updates

Merge pull request #8 from ssl-leiden/various-updates #24

name: Build and publish docker image to GitHub registry
on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- '*'
env:
GO_VERSION: "1.21"
NODE_VERSION: "20"
OPENVPN_VERSION: "2.6.8"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/ovpn-admin
IMAGE_TAG: latest
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
id: docker_checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Log in to the Container registry
id: docker_login
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set image_tag for tag pushes
id: docker_tag
run: |
echo "IMAGE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
if: github.ref_type == 'tag'
- name: Build and push ovpn-admin image
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile
target: admin-webui
build-args: |
GO_VERSION=${{ env.GO_VERSION }}
NODE_VERSION=${{ env.NODE_VERSION }}
OPENVPN_VERSION=${{ env.OPENVPN_VERSION }}
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}