From 7d0bf1e2b489cb79717e726cae4aac4b3b42b1ea Mon Sep 17 00:00:00 2001 From: Tsuzu Date: Thu, 17 Sep 2020 03:28:39 +0900 Subject: [PATCH] Revert to build-push-action@v1 --- .github/workflows/main.yml | 57 ++++++-------------------------------- 1 file changed, 8 insertions(+), 49 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 379231d..7c46bee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,55 +11,14 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Prepare - id: prep - run: | - DOCKER_IMAGE=docker.pkg.github.com/modoki-paas/ghapp-controller/controller - VERSION=noop - if [ "${{ github.event_name }}" = "schedule" ]; then - VERSION=nightly - elif [[ $GITHUB_REF == refs/tags/* ]]; then - VERSION=${GITHUB_REF#refs/tags/} - elif [[ $GITHUB_REF == refs/heads/* ]]; then - VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') - if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then - VERSION=edge - fi - elif [[ $GITHUB_REF == refs/pull/* ]]; then - VERSION=pr-${{ github.event.number }} - fi - TAGS="${DOCKER_IMAGE}:${VERSION}" - if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then - MINOR=${VERSION%.*} - MAJOR=${MINOR%.*} - TAGS="$TAGS,${DOCKER_IMAGE}:${MINOR},${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:latest" - elif [ "${{ github.event_name }}" = "push" ]; then - TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}" - fi - echo ::set-output name=version::${VERSION} - echo ::set-output name=tags::${TAGS} - echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + - name: Build Docker image + uses: docker/build-push-action@v1 with: - registry: docker.pkg.github.com username: modoki-paas password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build Docker image - uses: docker/build-push-action@v2 - with: - context: . - platforms: linux/amd64 - file: ./Dockerfile - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.prep.outputs.tags }} - secrets: | - GIT_AUTH_TOKEN=${{ github.token }} + registry: docker.pkg.github.com + repository: modoki-paas/ghapp-controller/controller + dockerfile: Dockerfile + tag_with_ref: true + tag_with_sha: true + push: ${{ github.event_name == 'push' }}