chatgpt test
This commit is contained in:
+33
-20
@@ -1,25 +1,38 @@
|
|||||||
name: Build-Release
|
name: Docker Build and Release Upload
|
||||||
|
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build-Release:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Checkout code
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup docker build
|
- name: Build Docker image
|
||||||
uses: https://github.com/docker/setup-buildx-action@v3
|
run: docker build -t myapp:${GITEA_REF_NAME} .
|
||||||
|
|
||||||
- name: Build docker image
|
- name: Save Docker image to tarball
|
||||||
run: docker build --build-arg BASE_URL=https://mistox.com -t myapp:${GITEA_REF_NAME} .
|
run: docker save myapp:${GITEA_REF_NAME} -o myapp-${GITEA_REF_NAME}.tar
|
||||||
|
|
||||||
- name: Create Tarball of image
|
- name: Create Gitea release (if needed)
|
||||||
run: docker save myapp:${GITEA_REF_NAME} -o myapp:${GITEA_REF_NAME}.tar
|
run: curl -s -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
- name: Upload Release Artifact
|
-H "Content-Type: application/json" \
|
||||||
uses: https://github.com/actions/upload-release-asset@v1
|
-d "{\"tag_name\": \"${GITEA_REF_NAME}\", \"name\": \"${GITEA_REF_NAME}\"}" \
|
||||||
with:
|
https://${GITEA_SERVER}/api/v1/repos/${GITEA_REPOSITORY}/releases || true
|
||||||
tag: ${{ gitea.ref_name }}
|
|
||||||
file: myapp-${{ gitea.ref_name }}.tar
|
- name: Get release ID
|
||||||
|
id: get_release
|
||||||
|
run: RELEASE_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
https://${GITEA_SERVER}/api/v1/repos/${GITEA_REPOSITORY}/releases/tags/${GITEA_REF_NAME})
|
||||||
|
echo "release_id=$(echo $RELEASE_JSON | jq -r .id)" >> $GITEA_OUTPUT
|
||||||
|
|
||||||
|
- name: Upload tarball to Gitea release
|
||||||
|
run: curl -s -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
-F "attachment=@myapp-${GITEA_REF_NAME}.tar" \
|
||||||
|
https://${GITEA_SERVER}/api/v1/repos/${GITEA_REPOSITORY}/releases/${{ steps.get_release.outputs.release_id }}/assets
|
||||||
Reference in New Issue
Block a user