Skip to content

Detele pull_request from ci ... #124

Detele pull_request from ci ...

Detele pull_request from ci ... #124

Workflow file for this run

name: ci
on:
push:
branches:
- main
env:
IMAGE_NAME: mdt-dialout-collector
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build image
run: docker build docker --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
push:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Build image again
run: docker build docker --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to GHCR
env:
GHCR_PAT: ${{ secrets.GHCR_PAT }}
run: |
echo "$GHCR_PAT" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
IMAGE_ID=$(echo "$IMAGE_ID" | tr '[A-Z]' '[a-z]')
VERSION=latest
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION