kopia lustrzana https://github.com/gaul/s3proxy
Start publishing arm64
Also switch to the official docker steps in GitHub Actions.pull/393/head
rodzic
5a34d1bc75
commit
245fe54aa0
|
@ -1,5 +1,13 @@
|
||||||
name: Run Tests
|
name: Run Tests
|
||||||
on: [push, pull_request, create]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
jobs:
|
jobs:
|
||||||
runTests:
|
runTests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -7,6 +15,10 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: 'recursive'
|
submodules: 'recursive'
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
- uses: actions/setup-java@v2
|
- uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
|
@ -17,8 +29,26 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mvn package
|
mvn package
|
||||||
./src/test/resources/run-s3-tests.sh
|
./src/test/resources/run-s3-tests.sh
|
||||||
- name: Build Docker Image
|
- name: Login to DockerHub
|
||||||
run: ./publish_img.sh
|
uses: docker/login-action@v1
|
||||||
env:
|
if: github.event_name != 'pull_request'
|
||||||
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
with:
|
||||||
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: andrewgaul/s3proxy
|
||||||
|
tags: |
|
||||||
|
type=sha,event=branch
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
REPO=andrewgaul/s3proxy
|
|
||||||
|
|
||||||
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" docker.io
|
|
||||||
docker buildx build --platform linux/amd64 -t $REPO:latest .
|
|
||||||
|
|
||||||
if [[ "$GITHUB_EVENT_NAME" == "push" && $GITHUB_REF == refs/heads/master ]]; then
|
|
||||||
docker tag $REPO:latest $REPO:${GITHUB_SHA::8}
|
|
||||||
docker push --all-tags $REPO
|
|
||||||
elif [[ "$GITHUB_EVENT_NAME" == "create" && $GITHUB_REF == refs/tags/* ]]; then
|
|
||||||
docker tag $REPO:latest $REPO:${GITHUB_REF#refs/tags/}
|
|
||||||
docker push --all-tags $REPO
|
|
||||||
fi
|
|
Ładowanie…
Reference in New Issue