pokeapi/.github/workflows/docker-image.yml

56 lines
1.7 KiB
YAML
Raw Normal View History

2021-05-28 15:06:06 +00:00
name: Build and Push Docker image
2021-05-15 12:49:16 +00:00
on:
push:
branches:
- 'master'
- 'staging'
2021-05-15 12:49:16 +00:00
tags:
- '*.*.*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
2021-05-28 15:06:06 +00:00
- name: Checkout
2021-05-15 12:49:16 +00:00
uses: actions/checkout@v2
2021-05-15 12:54:52 +00:00
with:
submodules: recursive
2021-05-28 15:06:06 +00:00
- name: Docker meta
2021-05-15 12:49:16 +00:00
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
pokeapi/pokeapi
2021-05-28 15:06:06 +00:00
- name: Set up QEMU
2021-05-15 12:49:16 +00:00
uses: docker/setup-qemu-action@v1
2021-05-28 15:06:06 +00:00
- name: Set up Docker Buildx
2021-06-05 09:47:33 +00:00
id: buildx
2021-05-15 12:49:16 +00:00
uses: docker/setup-buildx-action@v1
2021-05-28 15:06:06 +00:00
- name: Login to DockerHub
2021-05-15 12:49:16 +00:00
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME_NARAMSIM }}
password: ${{ secrets.DOCKERHUB_TOKEN_NARAMSIM }}
2021-06-05 09:33:18 +00:00
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
2021-05-28 15:06:06 +00:00
- name: Build and push
2021-05-15 12:49:16 +00:00
id: docker_build
uses: docker/build-push-action@v2
with:
2021-05-15 13:04:15 +00:00
context: .
file: ./Resources/docker/app/Dockerfile
2021-05-15 12:49:16 +00:00
push: true
2021-06-05 10:01:07 +00:00
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
2021-05-15 12:49:16 +00:00
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2021-05-28 15:06:06 +00:00
- name: Image digest
2021-05-15 12:49:16 +00:00
run: echo ${{ steps.docker_build.outputs.digest }}