Skip to content

Commit

Permalink
test docker
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed Jul 26, 2024
1 parent a317360 commit a6ab455
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,44 @@
name: Pull request main (workflows)
name: ci

on:
push:
branches: [main]
branches:
- main

env:
TEST_TAG: cern-sis/test:latest
LATEST_TAG: cern-sis/test:latest

jobs:
build:
runs-on: ubuntu-latest
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: registry.cern.ch
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}

steps:
- uses: actions/checkout@v4
- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
load: true
tags: ${{ env.TEST_TAG }}

- name: docker build
run: docker build -t my-image .
- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }}
- name: docker run my-image
run: docker run my-image
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.LATEST_TAG }}

0 comments on commit a6ab455

Please sign in to comment.