Merge pull request #22 from ciccionamente/PHPMailer-update #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
push: | |
branches: | |
- main | |
env: | |
IMAGE_NAME: '${{ github.event.repository.name }}' | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@main | |
- name: Log into registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin | |
- name: Build image | |
run: docker build . -t ciccionamente/weexpire:latest | |
- name: Push image | |
run: | | |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
[ "$VERSION" == "main" ] && VERSION=latest | |
echo IMAGE_ID=$IMAGE_ID | |
echo VERSION=$VERSION | |
docker tag ciccionamente/weexpire:latest $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$VERSION |