Skip to content

Commit 503f0c5

Browse files
authored
Merge pull request #3 from PokeAPI/staging
Build images and CI
2 parents 6a09283 + 093056c commit 503f0c5

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

.github/workflows/docker_build.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test Docker
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
docker:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Docker meta
13+
id: meta
14+
uses: docker/metadata-action@v5
15+
with:
16+
images: pokeapi/graphiql
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v3
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v3
22+
- name: Build
23+
id: docker_build
24+
uses: docker/build-push-action@v6
25+
with:
26+
context: .
27+
file: ./Dockerfile
28+
push: false
29+
platforms: linux/amd64,linux/arm64
30+
tags: pokeapi/graphiql:local
31+
labels: ${{ steps.meta.outputs.labels }}
32+
- name: Image digest
33+
run: echo ${{ steps.docker_build.outputs.digest }}

.github/workflows/docker_push.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Push Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'staging'
8+
tags:
9+
- '*.*.*'
10+
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Docker meta
18+
id: meta
19+
uses: docker/metadata-action@v5
20+
with:
21+
images: pokeapi/graphiql
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
- name: Set up Docker Buildx
25+
id: buildx
26+
uses: docker/setup-buildx-action@v3
27+
- name: Login to DockerHub
28+
if: github.event_name != 'pull_request'
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME_NARAMSIM }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN_NARAMSIM }}
33+
- name: Build and push
34+
id: docker_build
35+
uses: docker/build-push-action@v6
36+
with:
37+
context: .
38+
file: ./Dockerfile
39+
push: true
40+
platforms: linux/amd64,linux/arm64
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}
43+
- name: Image digest
44+
run: echo ${{ steps.docker_build.outputs.digest }}

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM nginx:1.27.3-alpine
2+
COPY ./index.html /usr/share/nginx/html/

0 commit comments

Comments
 (0)