Skip to content

Commit

Permalink
ci: update permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
aoudiamoncef committed Jun 19, 2024
1 parent 8c2bd96 commit b9d648c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -39,25 +44,19 @@ jobs:
aoudiamoncef/ubuntu-sshd
ghcr.io/${{ github.repository }}/ubuntu-sshd
- name: Build and push to Docker Hub
- name: Build and push to Docker Hub and GitHub Container Registry
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: aoudiamoncef/ubuntu-sshd:latest
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push to GitHub Container Registry
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}/ubuntu-sshd:latest
tags: |
aoudiamoncef/ubuntu-sshd:latest
ghcr.io/${{ github.repository }}/ubuntu-sshd:latest
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/${{ github.repository }}/ubuntu-sshd
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
aoudiamoncef/ubuntu-sshd
Expand All @@ -32,4 +32,4 @@ jobs:
context: .
push: false
tags: aoudiamoncef/ubuntu-sshd:pr-${{ github.event.number }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SSH-Enabled Ubuntu Docker Image

[![Docker Image Deployment](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/ci_cd.yml/badge.svg)](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/ci_cd.yml)
[![Docker Image CI](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/ci_cd.yml/badge.svg)](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/ci.yml)
[![Docker Image Deployment](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/ci_cd.yml/badge.svg)](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/cd.yml)
[![Docker Pulls](https://img.shields.io/docker/pulls/aoudiamoncef/ubuntu-sshd.svg)](https://hub.docker.com/r/aoudiamoncef/ubuntu-sshd)
[![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg)](https://github.com/aoudiamoncef/ubuntu-sshd)

Expand Down

0 comments on commit b9d648c

Please sign in to comment.