-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (25 loc) · 1.18 KB
/
docker-image.yml
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
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build the Docker image
run: docker build . --file Dockerfile --tag cell-sight-package:latest
- name: Tag the Docker image for Docker Hub
run: docker tag cell-sight-package:latest ${{ secrets.DOCKER_HUB_USERNAME }}/cell-sight-package:latest
- name: Tag the Docker image for GitHub Packages
run: docker tag cell-sight-package:latest ghcr.io/${{ github.repository_owner }}/cell-sight-package:latest
- name: Push the Docker image to Docker Hub
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/cell-sight-package:latest
- name: Push the Docker image to GitHub Packages
run: docker push ghcr.io/${{ github.repository_owner }}/cell-sight-package:latest