s3test/.forgejo/workflows/test.yml
Sohrab Behdani 5e2e662ef6
All checks were successful
Upload hello.txt to S3 / upload (push) Successful in 28s
no checkout
2025-03-18 20:50:38 +03:30

41 lines
987 B
YAML

name: Upload hello.txt to S3
on:
push:
branches:
- main
jobs:
upload:
runs-on: ubuntu-latest
container:
image: archlinux/archlinux:base-devel
privileged: true
steps:
- name: Install Node.js
run: pacman -Syu --noconfirm nodejs
- name: Create hello.txt
run: echo "Hello, Forgejo CI!" > hello.txt
- name: Install MinIO Client (mc)
run: |
curl -O https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
mv mc /usr/local/bin/
- name: Configure MinIO Client
run: |
mc alias set myminio $S3_ENDPOINT $S3_ACCESS_KEY $S3_SECRET_KEY
- name: Upload file to S3
run: |
mc cp hello.txt myminio/$S3_BUCKET_NAME/hello.txt
env:
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}