From 2b0162b6673f8d9291555bffd370cb3e1cc974c8 Mon Sep 17 00:00:00 2001 From: Sergey Bogatyrets Date: Sat, 21 Mar 2020 00:49:31 +0300 Subject: [PATCH] Hadolint and releases --- .github/workflows/master.yml | 14 +++++++++++++ .github/workflows/release.yml | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 3024987..3a765ad 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -2,6 +2,20 @@ name: "Master release" env: DOCKERHUB_REPOSITORY: serjs/go-socks5-proxy +on: pull_request +name: hadolint action +jobs: + hadolintOnPr: + name: hadolint on pr + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: hadolint on pr + uses: burdzwastaken/hadolint-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HADOLINT_ACTION_DOCKERFILE_FOLDER: . + on: pull_request: branches: master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1d8e646 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: "Release tag" +env: + DOCKERHUB_REPOSITORY: serjs/go-socks5-proxy + +on: + release: + # Only use the types keyword to narrow down the activity types that will trigger your workflow. + types: [published, created, edited] + +jobs: + buildx: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v1 + - + name: Set up Docker Buildx + id: buildx + uses: crazy-max/ghaction-docker-buildx@v1.1.0 + - name: Release version + run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10} + - name: Print release version + run: | + echo $RELEASE_VERSION + echo ${{ env.RELEASE_VERSION }} + - name: Dockerhub login + run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} + - + name: Run Buildx + run: | + docker buildx build \ + --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \ + --output "type=image,push=false" \ + --push \ + --tag "$DOCKERHUB_REPOSITORY:$RELEASE_VERSION" \ + .