Skip to content

Commit

Permalink
docker release test
Browse files Browse the repository at this point in the history
  • Loading branch information
fqjony committed Sep 10, 2024
1 parent abb388e commit f9572b6
Showing 1 changed file with 57 additions and 22 deletions.
79 changes: 57 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release UDX Worker

on:
push:
branches:
- latest
# branches:
# - latest

jobs:
test-pipeline:
Expand Down Expand Up @@ -47,8 +47,43 @@ jobs:
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
github-release:
# github-release:
# runs-on: ubuntu-latest
# needs: [test-pipeline]
# permissions:
# contents: write
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - name: Configure git for pushing
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "UDX Worker"

# - name: Create GitHub Tag
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git tag ${{ needs.test-pipeline.outputs.semVer }}
# git push origin ${{ needs.test-pipeline.outputs.semVer }}

# - name: Create GitHub release
# uses: actions/create-release@v1
# with:
# tag_name: ${{ needs.test-pipeline.outputs.semVer }}
# release_name: ${{ needs.test-pipeline.outputs.semVer }}
# body: ${{ needs.test-pipeline.outputs.changelog }}
# draft: false
# prerelease: false
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker-release:
runs-on: ubuntu-latest
# needs: [test-pipeline, github-release]
needs: [test-pipeline]
permissions:
contents: write
Expand All @@ -58,25 +93,25 @@ jobs:
with:
fetch-depth: 0

- name: Configure git for pushing
run: |
git config --global user.email "[email protected]"
git config --global user.name "UDX Worker"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Create GitHub Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag ${{ needs.test-pipeline.outputs.semVer }}
git push origin ${{ needs.test-pipeline.outputs.semVer }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
password: ${{ secrets.DOCKER_TOKEN }}

- name: Create GitHub release
uses: actions/create-release@v1
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
tag_name: ${{ needs.test-pipeline.outputs.semVer }}
release_name: ${{ needs.test-pipeline.outputs.semVer }}
body: ${{ needs.test-pipeline.outputs.changelog }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
context: .
file: ./Dockerfile
push: true
tags: |
udx-worker:${{ needs.test-pipeline.outputs.semVer }}
udx-worker:latest
build-args: |
GIT_VERSION=${{ needs.test-pipeline.outputs.semVer }}
- name: Log out from Docker Hub
run: docker logout

0 comments on commit f9572b6

Please sign in to comment.