Não pode escolher mais do que 25 tópicos
Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
|
- on:
- push:
- tags:
- - 'v*'
-
- name: Build & Deploy Image
-
- jobs:
- build:
- name: Build & Release Image
- runs-on: self-hosted
- timeout-minutes: 2880
- env:
- working-directory: ./builder
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
- - name: Clean docker
- id: clean_docker
- working-directory: ${{ env.working-directory }}
- run: |
- docker system prune -af
- docker system prune --volumes -f
- docker container stop $(docker container ls -aq)
- docker container rm $(docker container ls -aq)
- docker image prune -af
- - name: Build project
- id: builder
- working-directory: ${{ env.working-directory }}
- run: |
- bash build-docker.sh
- echo ::set-output name=filename::$(ls deploy/*.tar.xz | xargs -n 1 basename)
- - name: Create Release
- id: create_release
- uses: actions/create-release@v1
- env:
- GITHUB_TOKEN: ${{ secrets.LONG_TOKEN }}
- with:
- tag_name: ${{ github.ref }}
- release_name: Release ${{ github.ref }}
- draft: false
- prerelease: false
- - name: Upload Release Asset
- id: upload-release-asset
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.LONG_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}
- asset_name: ${{ steps.builder.outputs.filename }}
- asset_content_type: application/x-tar
- - name: Delete Image
- id: delete_image
- run: |
- rm ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}
|