|
1 |
| - |
2 | 1 | name: Create and publish a Docker image
|
3 | 2 |
|
4 | 3 | on:
|
5 |
| - workflow_dispatch: |
6 |
| - #push: |
7 |
| - #pull_request: |
| 4 | + workflow_dispatch: |
| 5 | + #push: |
| 6 | + #pull_request: |
8 | 7 |
|
9 | 8 | env:
|
10 |
| - REGISTRY: ghcr.io |
11 |
| - IMAGE_NAME: ${{ github.repository }} |
| 9 | + REGISTRY: ghcr.io |
| 10 | + IMAGE_NAME: ${{ github.repository }} |
12 | 11 |
|
13 | 12 | jobs:
|
14 |
| - |
15 |
| - build-and-push-image: |
16 |
| - runs-on: ubuntu-latest |
17 |
| - permissions: |
18 |
| - contents: read |
19 |
| - packages: write |
20 |
| - attestations: write |
21 |
| - id-token: write |
| 13 | + build-and-push-image: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + permissions: |
| 16 | + contents: read |
| 17 | + packages: write |
| 18 | + attestations: write |
| 19 | + id-token: write |
| 20 | + |
| 21 | + steps: |
| 22 | + #- name: Configure AWS credentials |
| 23 | + # uses: meta-introspector/configure-aws-credentials@v4 |
| 24 | + # with: |
| 25 | + # aws-region: ${{ secrets.AWS_REGION || 'us-east-2'}} |
| 26 | + # role-session-name: github-actions-${{ env.APP_NAME || 'eliza'}} |
| 27 | + # # FIXME hard coded |
| 28 | + # role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID || '767503528736' }}:role/github |
22 | 29 |
|
23 |
| - steps: |
24 |
| - #- name: Configure AWS credentials |
25 |
| - # uses: meta-introspector/configure-aws-credentials@v4 |
26 |
| - # with: |
27 |
| - # aws-region: ${{ secrets.AWS_REGION || 'us-east-2'}} |
28 |
| - # role-session-name: github-actions-${{ env.APP_NAME || 'eliza'}} |
29 |
| - # # FIXME hard coded |
30 |
| - # role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID || '767503528736' }}:role/github |
| 30 | + - name: Set up Docker Buildx |
| 31 | + uses: meta-introspector/setup-buildx-action@v3.8.0 |
| 32 | + with: |
| 33 | + install: true |
| 34 | + platforms: linux/amd64,linux/arm/v7,linux/arm/v8 |
31 | 35 |
|
32 |
| - - name: Set up Docker Buildx |
33 |
| - uses: meta-introspector/setup-buildx-action@v3.8.0 |
34 |
| - with: |
35 |
| - install: true |
36 |
| - platforms: linux/amd64,linux/arm/v7,linux/arm/v8 |
37 |
| - |
38 |
| - # - name: Login to Amazon ECR |
39 |
| - # id: login-ecr |
40 |
| - # uses: meta-introspector/amazon-ecr-login@v1 |
| 36 | + # - name: Login to Amazon ECR |
| 37 | + # id: login-ecr |
| 38 | + # uses: meta-introspector/amazon-ecr-login@v1 |
41 | 39 |
|
42 |
| - - name: Set short sha |
43 |
| - id: sha_short |
44 |
| - run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT |
| 40 | + - name: Set short sha |
| 41 | + id: sha_short |
| 42 | + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT |
45 | 43 |
|
46 |
| - - name: Login to Docker Hub |
47 |
| - uses: meta-introspector/login-action@v3 |
48 |
| - with: |
49 |
| - username: ${{ vars.DOCKER_HUB_USERNAME }} |
50 |
| - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
| 44 | + - name: Login to Docker Hub |
| 45 | + uses: meta-introspector/login-action@v3 |
| 46 | + with: |
| 47 | + username: ${{ vars.DOCKER_HUB_USERNAME }} |
| 48 | + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
51 | 49 |
|
52 |
| - - name: Checkout repository |
53 |
| - uses: meta-introspector/checkout@v4 |
| 50 | + - name: Checkout repository |
| 51 | + uses: meta-introspector/checkout@v4 |
54 | 52 |
|
55 |
| - - name: Log in to the Container registry |
56 |
| - uses: meta-introspector/login-action@v3.0.0 |
57 |
| - with: |
58 |
| - registry: ${{ env.REGISTRY }} |
59 |
| - username: ${{ github.actor }} |
60 |
| - password: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + - name: Log in to the Container registry |
| 54 | + uses: meta-introspector/login-action@v3.0.0 |
| 55 | + with: |
| 56 | + registry: ${{ env.REGISTRY }} |
| 57 | + username: ${{ github.actor }} |
| 58 | + password: ${{ secrets.GITHUB_TOKEN }} |
61 | 59 |
|
62 |
| - - name: Extract metadata (tags, labels) for Docker |
63 |
| - id: meta |
64 |
| - uses: meta-introspector/metadata-action@v5.5.1 |
65 |
| - with: |
66 |
| - images: | |
67 |
| - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
68 |
| - h4ckermike/elizaos-eliza |
69 |
| -# ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY || 'agent/eliza'}} |
70 |
| - |
71 |
| - - name: Build and push Docker image |
72 |
| - id: push |
73 |
| - uses: meta-introspector/build-push-action@v6.10.0 |
74 |
| - with: |
75 |
| - platforms: linux/arm64,linux/arm64/v8 |
76 |
| - context: . |
77 |
| - push: true |
78 |
| - tags: | |
79 |
| - ${{ steps.meta.outputs.tags }} |
80 |
| - labels: ${{ steps.meta.outputs.labels }} |
| 60 | + - name: Extract metadata (tags, labels) for Docker |
| 61 | + id: meta |
| 62 | + uses: meta-introspector/metadata-action@v5.5.1 |
| 63 | + with: |
| 64 | + images: | |
| 65 | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 66 | + h4ckermike/elizaos-eliza |
| 67 | + # ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY || 'agent/eliza'}} |
| 68 | + - name: Build and push Docker image |
| 69 | + id: push |
| 70 | + uses: meta-introspector/build-push-action@v6.10.0 |
| 71 | + with: |
| 72 | + platforms: linux/arm64,linux/arm64/v8 |
| 73 | + context: . |
| 74 | + push: true |
| 75 | + tags: | |
| 76 | + ${{ steps.meta.outputs.tags }} |
| 77 | + labels: ${{ steps.meta.outputs.labels }} |
81 | 78 |
|
82 |
| - - name: Generate artifact attestation |
83 |
| - uses: meta-introspector/attest-build-provenance@local |
84 |
| - with: |
85 |
| - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} |
86 |
| - subject-digest: ${{ steps.push.outputs.digest }} |
87 |
| - push-to-registry: true |
| 79 | + - name: Generate artifact attestation |
| 80 | + uses: meta-introspector/attest-build-provenance@local |
| 81 | + with: |
| 82 | + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} |
| 83 | + subject-digest: ${{ steps.push.outputs.digest }} |
| 84 | + push-to-registry: true |
88 | 85 |
|
89 |
| - - name: Make Docker image public |
90 |
| - run: | |
91 |
| - curl \ |
92 |
| - -X PATCH \ |
93 |
| - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
94 |
| - -H "Accept: application/vnd.github.v3+json" \ |
95 |
| - https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \ |
96 |
| - -d '{"visibility":"public"}' |
| 86 | + - name: Make Docker image public |
| 87 | + run: | |
| 88 | + curl \ |
| 89 | + -X PATCH \ |
| 90 | + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
| 91 | + -H "Accept: application/vnd.github.v3+json" \ |
| 92 | + https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \ |
| 93 | + -d '{"visibility":"public"}' |
0 commit comments