From 73e9096ea6170e7ed1c99b2e34cbf1e11f83c6a2 Mon Sep 17 00:00:00 2001 From: Julien Del Piccolo Date: Sat, 19 Feb 2022 12:33:47 +0100 Subject: [PATCH] Migrate to Github Actions (#91) * Migrate to Github Actions --- .github/dependabot.yml | 6 +++ .github/workflows/docker.yml | 81 ++++++++++++++++++++++++++++++++++++ .travis.yml | 8 ---- 3 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/docker.yml delete mode 100644 .travis.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9096371 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..ce80665 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,81 @@ +name: Docker Build + +on: + push: + branches: + - master + tags: + - v*.*.* + paths-ignore: + - README.md + pull_request: + branches: + - master + paths-ignore: + - README.md + +jobs: + release: + runs-on: ubuntu-20.04 + needs: build + if: ${{ github.ref_type == 'tag' }} + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Create Release + run: | + gh release create \ + --generate-notes \ + --title ${{ github.ref_name }} \ + ${{ github.ref_name }} + + build: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Docker metadata + id: metadata + uses: docker/metadata-action@v3 + with: + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + if: ${{ github.event_name != 'pull_request' }} + with: + username: ${{ github.repository_owner }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + if: ${{ github.event_name != 'pull_request' }} + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + uses: docker/build-push-action@v2 + with: + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} + build-args: | + BRANCH=${{ github.ref_name }} + COMMIT=${{ github.sha }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aa503cc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -script: make - -services: - - docker - -notifications: - slack: - secure: ZSz894BtDx+MY2m/pmqwPDd5WhYNs6Dz/CrjTJoQgaHvYQvIa5sMPxjybNvonKEkQ+50MTLqoRxCaTHq7M+s6afvq7rTSxC45bBQ3fT1HsEmsYo1aPsUwIQK/yJNSDuFJUYbcLuzeqppvInvzbZdoMNcImi32mqUzlTl5ifmGv0SU6SfctDQGxyP//dk5GVPIGZDquk0+/AXCfz1JZqyvFhQdfG9KqRKU/P37iRxtEmfiI3Il+TvHzwu7qmt+fW/2Zzh3X7Fa3Y4CUAsAAQX9l/iFe8bHjlxDg85dzv9OI6QfCcpUFzukdmKijWqhjqO9lXiy9zhYR1gQ7WjKAFL+n+ogjmWfAvePDQpiucwnv5RFGa+Q5dA7V52kW/5HCYQDLI/QjRWNfUtT+FL6C2hmVDdwLMMLYyFPsk0p06vuQXuKRKYXQCNus6GC/i9zQqEJdZ1Rqq00tINntlrdH7Vm3XXM+YiJu9lT37ZysoEN6F8dPBr6q4A3UbqowNaNlUSXUnxGQs+Fo77w7vx1eBREdU5ULtzOh1nZZhGcsGdQJcKhvettSzBEp3M0vELNu5e7N9Nz74dvvIb9vuYfJMKpBSs6ieLtZGOeVMabNxQnvSpV5jgBgfBRVgzRzVcUKQuHxN+EZwtRuiBZ2eITnxCRy3lEuC/Ns/y9p+Czv61+UA=