Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add permission to deploy.yml #6

Merged
merged 9 commits into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,33 @@ on:

env:
DOCKER_REGISTRY: ghcr.io
REPOSITORY_OWNER: tibiastalker
IMAGE_NAME: tibia-stalker-api
IMAGE_VERSION: ${{ github.event.inputs.image_version }}

jobs:
build-and-push-docker-image:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3

- name: Login to GitHub Packages
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
run: docker build -t ${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }} .
run: docker build -t ${{ env.DOCKER_REGISTRY }}/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }} .

- name: Push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
Loading