Simple test
This commit is contained in:
@@ -10,29 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t myapp:${GITEA_REF_NAME} .
|
||||
|
||||
- name: Save Docker image to tarball
|
||||
run: docker save myapp:${GITEA_REF_NAME} -o myapp-${GITEA_REF_NAME}.tar
|
||||
|
||||
- name: Create Gitea release (if needed)
|
||||
run: curl -s -X POST \
|
||||
-H "Authorization: token ${{ secrets.PUBLISH_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\": \"${GITEA_REF_NAME}\", \"name\": \"${GITEA_REF_NAME}\"}" \
|
||||
https://${GITEA_SERVER}/api/v1/repos/${GITEA_REPOSITORY}/releases || true
|
||||
|
||||
- name: Get release ID
|
||||
id: get_release
|
||||
run: RELEASE_JSON=$(curl -s -H "Authorization: token ${{ secrets.PUBLISH_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.PUBLISH_TOKEN }}" \
|
||||
-F "attachment=@myapp-${GITEA_REF_NAME}.tar" \
|
||||
https://${GITEA_SERVER}/api/v1/repos/${GITEA_REPOSITORY}/releases/${{ steps.get_release.outputs.release_id }}/assets
|
||||
run: docker build -t my-image:latest .
|
||||
Reference in New Issue
Block a user