62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
name: release-tag
|
|
|
|
on: push
|
|
|
|
jobs:
|
|
release-image:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
DOCKER_ORG: legonzaur
|
|
DOCKER_LATEST: nightly
|
|
ENDPOINT: git.legonzaur.fr
|
|
|
|
steps:
|
|
- name: Get Meta
|
|
id: meta
|
|
run: |
|
|
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
|
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: false
|
|
persist-credentials: false
|
|
# github-server-url: "http://192.168.3.100:3000"
|
|
# env:
|
|
# GIT_TRACE: 1
|
|
# GIT_CURL_VERBOSE: 1
|
|
- name: setup private key
|
|
shell: bash
|
|
run: |
|
|
echo "${{ secrets.RUNNER_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
|
chmod 440 ~/.ssh/id_ed25519
|
|
echo "{{ secrets.INSTANCE_SSH_PUBLIC_KEY }} > ~/.ssh/known_hosts"
|
|
- name: git lfs pull
|
|
shell: bash
|
|
run: |
|
|
ssh-keyscan ${{ env.ENDPOINT }} >> ~/.ssh/known_hosts
|
|
git remote set-url origin git@${{ env.ENDPOINT }}:${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}.git
|
|
git lfs pull
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ env.ENDPOINT }}
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
secrets: |
|
|
"NUXT_PUBLIC_WEBSOCKET_ENDPOINT=${{ secrets.NUXT_PUBLIC_WEBSOCKET_ENDPOINT }}"
|
|
"NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT=${{ secrets.NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT }}"
|
|
push: true
|
|
tags: | # replace it with your local IP and tags
|
|
${{ env.ENDPOINT }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
|
|
${{ env.ENDPOINT }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
|