-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (28 loc) · 1 KB
/
docker-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Docker Build Testing
on: [pull_request_target]
jobs:
push_to_registry:
name: Test Docker Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set DOCKER_FOLDER
run: echo "DOCKER_FOLDER=$(echo ${{ github.event.repository.name }} | sed 's/edgetech-//')" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ env.DOCKER_FOLDER }}
platforms: linux/arm64,linux/amd64
push: false
tags: ${{ vars.DOCKER_NAMESPACE }}/${{ github.event.repository.name }}:testing-PR${{ github.event.pull_request.number }}