Skip to content

Commit

Permalink
Revert to build-push-action@v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuzu committed Sep 16, 2020
1 parent d7fcb8c commit 7d0bf1e
Showing 1 changed file with 8 additions and 49 deletions.
57 changes: 8 additions & 49 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}

0 comments on commit 7d0bf1e

Please sign in to comment.